Array__Attack Class

Typed wrapper around Godot’s Array class, an array of Variant typed elements allocated in the engine in C++. Useful when interfacing with the engine. Otherwise prefer .NET collections such as arrays or .

Constructors

Array__Attack.__new()

Constructs a new empty .

Array__Attack.__new()

Array__Attack.__new(IEnumerable__Attack)

Array__Attack.__new(collection: IEnumerable__Attack)
Type Name Description
IEnumerable__Attack collection

Array__Attack.__new(Attack[])

Array__Attack.__new(array: Attack[])
Type Name Description
Attack[] array

Array__Attack.__new(Array)

Constructs a typed from an untyped .

Array__Attack.__new(array: Array)
Type Name Description
Array array The untyped array to construct from.

ReadOnly

Type Name Static Default Description
number Count Returns the number of elements in this . This is also known as the size or length of the array.
boolean IsReadOnly Returns if the array is read-only. See .

Properties

Type Getter Setter Static Default Description
Attack get_Item() set_Item(val)

Functions

Requires an instance!

Duplicate(boolean)

Duplicates this .

Duplicate(deep: boolean = False) -> Array__Attack
Type Name Description
boolean deep If , performs a deep copy.

Fill(Attack)

Fill(value: Attack) -> nil
Type Name Description
Attack value

Max

Returns the maximum value contained in the array if all elements are of comparable types. If the elements can’t be compared, is returned.

Max() -> Attack

Min

Returns the minimum value contained in the array if all elements are of comparable types. If the elements can’t be compared, is returned.

Min() -> Attack

PickRandom

Returns a random value from the target array.

PickRandom() -> Attack

RecursiveEqual(Array__Attack)

Compares this against the recursively. Returns if the sizes and contents of the arrays are equal, otherwise.

RecursiveEqual(other: Array__Attack) -> boolean
Type Name Description
Array__Attack other The other array to compare against.

Resize(number)

Resizes this to the given size.

Resize(newSize: number) -> Error
Type Name Description
number newSize The new size of the array.

Reverse

Reverses the order of the elements in the array.

Reverse() -> nil

Shuffle

Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as . Call to ensure that a new seed will be used each time if you want non-reproducible shuffling.

Shuffle() -> nil

Slice(number)

Creates a shallow copy of a range of elements in the source .

Slice(start: number) -> Array__Attack
Type Name Description
number start The zero-based index at which the range starts.

Slice(number,number)

Creates a shallow copy of a range of elements in the source .

Slice(start: number,length: number) -> Array__Attack
Type Name Description
number start The zero-based index at which the range starts.
number length The length of the range.

GetSliceRange(number,number,number,boolean)

Returns the slice of the , from (inclusive) to (exclusive), as a new . The absolute value of and will be clamped to the array size. If either or are negative, they will be relative to the end of the array (i.e. arr.GetSliceRange(0, -2) is a shorthand for arr.GetSliceRange(0, arr.Count - 2)). If specified, is the relative index between source elements. It can be negative, then must be higher than . For example, [0, 1, 2, 3, 4, 5].GetSliceRange(5, 1, -2) returns [5, 3]. If is true, each element will be copied by value rather than by reference.

GetSliceRange(start: number,end: number,step: number = 1,deep: boolean = False) -> Array__Attack
Type Name Description
number start The zero-based index at which the range starts.
number end The zero-based index at which the range ends.
number step The relative index between source elements to take.
boolean deep If , performs a deep copy.

Sort

Sorts the array. Note: The sorting algorithm used is not stable. This means that values considered equal may have their order changed when using . Note: Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. To sort with a custom predicate use .

Sort() -> nil

IndexOf(Attack)

IndexOf(item: Attack) -> number
Type Name Description
Attack item

IndexOf(Attack,number)

IndexOf(item: Attack,index: number) -> number
Type Name Description
Attack item
number index

LastIndexOf(Variant)

Searches the array for a value in reverse order and returns its index or -1 if not found.

LastIndexOf(item: Variant) -> number
Type Name Description
Variant item The item to search for.

LastIndexOf(Variant,number)

Searches the array for a value in reverse order and returns its index or -1 if not found.

LastIndexOf(item: Variant,index: number) -> number
Type Name Description
Variant item The item to search for.
number index The initial search index to start from.

Insert(number,Attack)

Insert(index: number,item: Attack) -> nil
Type Name Description
number index
Attack item

RemoveAt(number)

Removes an element from the array by index. To remove an element by searching for its value, use instead.

RemoveAt(index: number) -> nil
Type Name Description
number index The index of the element to remove.

MakeReadOnly

Makes the read-only, i.e. disabled modying of the array’s elements. Does not apply to nested content, e.g. content of nested arrays.

MakeReadOnly() -> nil

Add(Attack)

Add(item: Attack) -> nil
Type Name Description
Attack item

AddRange(IEnumerable__Attack)

Adds the elements of the specified collection to the end of this .

AddRange(collection: IEnumerable__Attack) -> nil
Type Name Description
IEnumerable__Attack collection Collection of items to add.

BinarySearch(number,number,Attack)

BinarySearch(index: number,count: number,item: Attack) -> number
Type Name Description
number index
number count
Attack item

BinarySearch(Attack)

BinarySearch(item: Attack) -> number
Type Name Description
Attack item

Clear

Clears the array. This is the equivalent to using with a size of 0

Clear() -> nil

Contains(Attack)

Contains(item: Attack) -> boolean
Type Name Description
Attack item

CopyTo(Attack[],number)

CopyTo(array: Attack[],arrayIndex: number) -> nil
Type Name Description
Attack[] array
number arrayIndex

Remove(Attack)

Remove(item: Attack) -> boolean
Type Name Description
Attack item

GetEnumerator

Gets an enumerator for this .

GetEnumerator() -> IEnumerator__Attack

ToString

Converts this to a string.

ToString() -> string

Categories:

Updated: