Array

Generic array, contains several elements of any type, accessible by numerical index starting at 0. Negative indices can be used to count from the right, like in Python. Arrays are always passed by reference.

struct Array {}

Constructors

this
this()
Undocumented in source.
this
this(typeof(null) n)
Undocumented in source.
this
this(PoolByteArray a)
Undocumented in source.
this
this(PoolIntArray a)
Undocumented in source.
this
this(PoolRealArray a)
Undocumented in source.
this
this(PoolStringArray a)
Undocumented in source.
this
this(PoolVector2Array a)
Undocumented in source.
this
this(PoolVector3Array a)
Undocumented in source.
this
this(PoolColorArray a)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Aliases

length
alias length = size
Undocumented in source.
opDollar
alias opDollar = size
Undocumented in source.

Functions

append
void append(T t)

Append a single element.

appendArray
void appendArray(Array other)

Concatenate a range or another Array to the end of this one.

appendRange
void appendRange(R other)

Concatenate a range or another Array to the end of this one.

as
T as()

Convert to a static array. Excess elements are discarded if the Array is longer than T.

back
Variant back()
Undocumented in source. Be warned that the author may not have intended to support it.
clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
count
size_t count(Variant v)
Undocumented in source. Be warned that the author may not have intended to support it.
dup
Array dup()

Allocate a new separate copy of the Array

empty
bool empty()
Undocumented in source. Be warned that the author may not have intended to support it.
erase
void erase(T v)
Undocumented in source. Be warned that the author may not have intended to support it.
find
int find(T what, size_t from)
Undocumented in source. Be warned that the author may not have intended to support it.
findLast
int findLast(T what)
Undocumented in source. Be warned that the author may not have intended to support it.
front
Variant front()
Undocumented in source. Be warned that the author may not have intended to support it.
has
bool has(T what)
Undocumented in source. Be warned that the author may not have intended to support it.
hash
uint hash()
Undocumented in source. Be warned that the author may not have intended to support it.
insert
void insert(size_t pos, T value)
Undocumented in source. Be warned that the author may not have intended to support it.
invert
void invert()
Undocumented in source. Be warned that the author may not have intended to support it.
opApply
int opApply(int delegate(size_t, ref Variant) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
opApply
int opApply(int delegate(size_t, const(Variant)) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
opApply
int opApply(int delegate(ref Variant) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
opApply
int opApply(int delegate(const(Variant)) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
Array opAssign(Array other)
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
Array opAssign(typeof(null) n)

Assigning null empties the Array variable, but unlike clear, does not destroy the original memory unless it was the only remaining reference.

opBinary
Array opBinary(R other)
Array opBinary(Array other)
opBinaryRight
Array opBinaryRight(R other)

Concatenate two arrays into a new one. The originals are left unaffected if there are still other references to them remaining.

opIndex
inout(Variant) opIndex(size_t idx)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndexAssign
void opIndexAssign(T value, size_t idx)
Undocumented in source. Be warned that the author may not have intended to support it.
opSlice
const(Variant)[] opSlice(size_t start, size_t end)
Variant[] opSlice()
opSlice
Variant[] opSlice(size_t start, size_t end)
const(Variant)[] opSlice()
popBack
Variant popBack()
Undocumented in source. Be warned that the author may not have intended to support it.
popFront
Variant popFront()
Undocumented in source. Be warned that the author may not have intended to support it.
pushBack
void pushBack(T v)
Undocumented in source. Be warned that the author may not have intended to support it.
pushFront
void pushFront(T v)
Undocumented in source. Be warned that the author may not have intended to support it.
remove
void remove(size_t idx)
Undocumented in source. Be warned that the author may not have intended to support it.
resize
void resize(size_t size)
Undocumented in source. Be warned that the author may not have intended to support it.
rfind
int rfind(T what, size_t from)
Undocumented in source. Be warned that the author may not have intended to support it.
size
size_t size()
Undocumented in source. Be warned that the author may not have intended to support it.
slice
Array slice(size_t start, size_t end, size_t stride, bool deep)
sort
void sort()
Undocumented in source. Be warned that the author may not have intended to support it.
toHash
hash_t toHash()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

empty_array
deprecated Array empty_array()
Undocumented in source. Be warned that the author may not have intended to support it.
from
Array from(T t)

Create an Array from any D range or static array with compatible elements.

make
Array make(Args args)

Create an array and add all $(PARAM args) to it.

Templates

opOpAssign
template opOpAssign(string op)

Append a single element.

Variables

_godot_array
godot_array _godot_array;
Undocumented in source.

Meta