![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
A generic array template class for moveable objects eg. structs or fundamental data types like UInt32, Real, etc.
The array class works for moveable objects only, use ObjectArray class for storing non-moveable objects.
This class is based on the NTL Vector container, see http://www.ultimatepp.org
The template parameter value type.
Definition of the const iterator.
Definition of the iterator.
Construct an empty array.
Murl.Array.IGameControllerMappingAxisMapping new()
Construct an array from an already existing one, performing a deep copy.
Murl.Array.IGameControllerMappingAxisMapping new(Murl.Array.IGameControllerMappingAxisMapping other)
other | The array to copy. |
Construct an array containing a single item.
Murl.Array.IGameControllerMappingAxisMapping new(Murl.IGameControllerMapping.AxisMapping item)
item | The item. |
Construct an array containing two items.
Murl.Array.IGameControllerMappingAxisMapping new(Murl.IGameControllerMapping.AxisMapping item1, Murl.IGameControllerMapping.AxisMapping item2)
item1 | The first item. |
item2 | The second item. |
Construct an array containing three items.
Murl.Array.IGameControllerMappingAxisMapping new(Murl.IGameControllerMapping.AxisMapping item1, Murl.IGameControllerMapping.AxisMapping item2, Murl.IGameControllerMapping.AxisMapping item3)
item1 | The first item. |
item2 | The second item. |
item3 | The third item. |
Clear the array and remove the underlying storage.
Clear()
Empty the array, but keep the underlying storage.
Empty()
Shrink the array so that the underlying storage is only as large as necessary.
Shrink()
Reduce the array to a given number of items.
n | The new number of items in the array, must be smaller than the current item count. |
Reduce the array by removing a given number of items from the end.
n | The number of items to remove from the end. |
Reserve storage space. If the given size is less than the actual size, nothing is done.
Reserve(Integer n)
n | The number of items the underlying storage should hold. |
Set the actual number of items in the array. If the given number is smaller than the current size, the array is trimmed, and existing items beyond the new size are destroyed. If the given number is higher, new items are initialized via the value type's default constructor. If the given number is also higher than the underlying storage's capacity, the storage is enlarged to hold exactly the requested number of items.
n | The new number of items in the array. |
Set the actual number of items in the array. If the given number is smaller than the current size, the array is trimmed, and existing items beyond the new size are destroyed. If the given number is higher, new items are initialized via the given value's copy constructor. If the given number is also higher than the underlying storage's capacity, the storage is enlarged to hold exactly the requested number of items.
Boolean SetCount(Integer n, Murl.IGameControllerMapping.AxisMapping item)
n | The new number of items in the array. |
item | The value to initialize any newly added items with. |
Set the actual number of items in the array and reserve extra storage space. If the given number is smaller than the current size, the array is trimmed, and existing items beyond the new size are destroyed. If the given number is higher, new items are initialized via the value type's default constructor. If the given number is also higher than the underlying storage's capacity, the storage is enlarged and some extra capacity is added.
Boolean SetCountAndReserve(Integer n)
n | The new number of items in the array. |
Set the actual number of items in the array and reserve extra storage space. If the given number is smaller than the current size, the array is trimmed, and existing items beyond the new size are destroyed. If the given number is higher, new items are initialized via the given value's copy constructor. If the given number is also higher than the underlying storage's capacity, the storage is enlarged and some extra capacity is added.
Boolean SetCountAndReserve(Integer n, Murl.IGameControllerMapping.AxisMapping item)
n | The new number of items in the array. |
item | The value to initialize any newly added items with. |
Initialize an item with a given item. If the given index is greater than the actual array size, the array is enlarged as needed.
Murl.IGameControllerMapping.AxisMapping Set(Integer index, Murl.IGameControllerMapping.AxisMapping item)
index | The index of the item to set. |
item | The source item to copy. |
Initialize a range of items with a given item. If the given index plus the count is greater than the actual array size, the array is enlarged as needed.
Boolean Set(Integer index, Murl.IGameControllerMapping.AxisMapping item, Integer count)
index | The index of the first item to set. |
item | The source item to copy. |
count | The number of items to set. |
Fill all items with a given item.
Fill(Murl.IGameControllerMapping.AxisMapping item)
item | The source item to copy. |
Swap two array items.
Swap(Integer index1, Integer index2)
index1 | The index of the first item. |
index2 | The index of the second item. |
Exchange the content of the array with a given second one.
Murl.Array.IGameControllerMappingAxisMapping Swap(Murl.Array.IGameControllerMappingAxisMapping other)
other | The second array. |
Add a new item at the end of the array. The new item entry is initialized using the value type's default constructor.
Murl.IGameControllerMapping.AxisMapping Add()
Add a given array of items at the end of the array. The new item entries are initialized using the original items' copy constructors.
Boolean Add(Murl.Array.IGameControllerMappingAxisMapping other)
other | The given item array to be inserted. |
Add a subset of given array of items at the end of the array. The new item entries are initialized using the original items' copy constructors.
Boolean Add(Murl.Array.IGameControllerMappingAxisMapping other, Integer offset, Integer count)
other | The given source item array. |
offset | The index into the source array specifying the first item to copy. |
count | The number of source array items to copy. |
Add a given item at the end of the array. The new item entry is initialized using the given item's copy constructor.
Murl.IGameControllerMapping.AxisMapping Add(Murl.IGameControllerMapping.AxisMapping item)
item | The given item to be inserted at the end of the array. |
Add a given number of new items at the end of the array. The new item entries are initialized using the value type's default constructor.
AddN(Integer count)
count | The number of new items to be inserted at the end of the array. |
Insert a new item at a given position. The new item entry is initialized using the value type's default constructor.
Murl.IGameControllerMapping.AxisMapping Insert(Integer index)
index | the zero-based index where the new item should be inserted. |
Insert a given array of items at a given position. The new item entries are initialized using the original items' copy constructors.
Boolean Insert(Integer index, Murl.Array.IGameControllerMappingAxisMapping other)
index | the zero-based index where the new items should be inserted. |
other | The given item array to be inserted. |
Insert a subset of given array of items at a given position. The new item entries are initialized using the original items' copy constructors.
Boolean Insert(Integer index, Murl.Array.IGameControllerMappingAxisMapping other, Integer offset, Integer count)
index | the zero-based index where the new items should be inserted. |
other | The given source item array. |
offset | The index into the source array specifying the first item to copy. |
count | The number of source array items to copy. |
Insert a given item at a given position. The new item is initialized using the given item's copy constructor.
Murl.IGameControllerMapping.AxisMapping Insert(Integer index, Murl.IGameControllerMapping.AxisMapping item)
index | the zero-based index where the new item should be inserted. |
item | The given item to be inserted. |
Insert a number of copies of a given item at a given position. The new item entries are initialized using the given item's copy constructor.
Boolean Insert(Integer index, Murl.IGameControllerMapping.AxisMapping item, Integer count)
index | the zero-based index where the new items should be inserted. |
item | The given item to be inserted. |
count | The number of copies of the given item to insert. |
Insert a given number of new items at a given position. The new item entries are initialized using the value type's default constructor.
Boolean InsertN(Integer index, Integer count)
index | the zero-based index where the new items should be inserted. |
count | The number of new items to be inserted. |
Remove (and destroy) an item at a given position and get a copy of the item.
Murl.IGameControllerMapping.AxisMapping RemoveGet(Integer index)
index | The zero-based index from where to remove the item. |
Remove (and destroy) a number of items at a given position.
Boolean Remove(Integer index, Integer count)
index | The zero-based index from where to remove the items. |
count | The number of items to remove. |
Remove (and destroy) a number of items at given positions.
Remove(Murl.Array.SInt32 sortedIndices)
sortedIndices | A sorted array of indices where to remove the items. |
Find the first occurrence of a given item in the array.
Integer Find(Murl.IGameControllerMapping.AxisMapping item)
item | The item to find. |
Find the first occurrence of a given item in the array.
Integer Find(Murl.IGameControllerMapping.AxisMapping item, Integer firstIndex)
item | The item to find. |
firstIndex | The index where to start searching. |
Find the last occurrence of a given item in the array.
Integer FindLast(Murl.IGameControllerMapping.AxisMapping item)
item | The item to find. |
Find the last occurrence of a given item in the array.
Integer FindLast(Murl.IGameControllerMapping.AxisMapping item, Integer lastIndex)
item | The item to find. |
lastIndex | The index where to start searching. |
Retrieve the first item from the array. Synonymous to Bottom().
Murl.IGameControllerMapping.AxisMapping Front()
Retrieve the last item from the array. Synonymous to Top().
Murl.IGameControllerMapping.AxisMapping Back()
Retrieve the first item from the array.
Murl.IGameControllerMapping.AxisMapping Bottom()
Retrieve the last item from the array.
Murl.IGameControllerMapping.AxisMapping Top()
Remove the last item from the array.
Murl.IGameControllerMapping.AxisMapping Pop()
Retrieve the item at a given position from the array. If the given index is greater than the actual array size, the array is enlarged as needed, using the value type's default constructor for initializing.
Murl.IGameControllerMapping.AxisMapping At(Integer index)
index | The zero-based index of the item to retrieve. |
Retrieve the item at a given position from the array. If the given index is greater than the actual array size, the array is enlarged as needed, using the given reference item's copy constructor for initializing.
Murl.IGameControllerMapping.AxisMapping At(Integer index, Murl.IGameControllerMapping.AxisMapping item)
index | The zero-based index of the item to retrieve. |
item | The reference item used for initialization. |
Get the number of items in the array.
Integer GetCount()
Get the number of items in the array.
Integer GetCountUInt32()
Check if the array is empty.
Boolean IsEmpty()
Get the number of actually allocated items.
Integer GetAlloc()
Compare the array to another one.
Boolean IsEqual(Murl.Array.IGameControllerMappingAxisMapping other)
other | The array to compare. |
Check if a given index is a valid index.
Boolean IsIndexValid(Integer index)
index | The index to check. |
Get the item at a given position from the array.
Murl.IGameControllerMapping.AxisMapping Get(Integer index)
index | The zero-based index of the item to retrieve. |
Get the number of bytes of the underlying raw array.
Integer GetByteSize()
ReAllocMove(Integer numAlloc)
The length operator is denoted by the unary prefix operator #.
The "equal to" comparison operator, calls IsEqual().
Retrieve the item at a given position from the array.
index | The zero-based index of the item to retrieve. |