DayZ Enforce
Script API
Private Member Functions | List of all members
array< class T > Class Reference

#include <proto.h>

Private Member Functions

proto int  Count ()
 
proto void  Clear ()
 
proto void  Set (int n, T value)
 
proto int  Find (T value)
 
proto T  Get (int n)
 
proto int  Insert (T value)
 
proto int  InsertAt (T value, int index)
 
void  InsertAll (array< T > from)
  Inserts all elements from array. More...
 
proto void  Remove (int n)
 
proto void  RemoveOrdered (int n)
 
proto void  Swap (array< T > other)
 
proto int  Copy (array< T > from)
 
proto int  Init (T init[])
 
void  RemoveItem (T value)
 
void  Debug ()
  Print all elements in array. More...
 
int  GetRandomIndex ()
  Returns a random index of array. More...
 
GetRandomElement ()
  Returns a random element of array. More...
 
void  SwapItems (int item1_index, int item2_index)
 

Member Function Documentation

proto int array< class T >::Count ( )
private
proto void array< class T >::Clear ( )
private
proto void array< class T >::Set ( int  n,
value 
)
private
proto int array< class T >::Find ( value )
private
proto T array< class T >::Get ( int  n )
private
proto int array< class T >::Insert ( value )
private

Inserts element at the end of array.

Parameters
a Element to be inserted
Returns
Position at which element is inserted
proto int array< class T >::InsertAt ( value,
int  index 
)
private

Inserts element at certain position and moves all elements behind this position by one.

Parameters
a Element to be inserted
index Position at which element is inserted. Must be less than Array::GetCardinality()
Returns
Number of elements after insertion
void array< class T >::InsertAll ( array< T >  from )
private

Inserts all elements from array.

Parameters
from array<T> array from which all elements will be added
arr1.Insert( "Dave" );
arr1.Insert( "Mark" );
arr1.Insert( "John" );
arr2.Insert( "Sarah" );
arr2.Insert( "Cate" );
arr1.InsertAll(arr2);
for ( int i = 0; i < arr1.Count(); i++ )
{
Print( arr1.Get(i) );
}
delete arr2;
delete arr1;
>> "Dave"
>> "Mark"
>> "John"
>> "Sarah"
>> "Cate"
proto void array< class T >::Remove ( int  n )
private

Removes element from array. The empty position is replaced by last element, so removal is quite fast but do not retain order.

Parameters
i Index of element to be removed
Returns
Removed element
proto void array< class T >::RemoveOrdered ( int  n )
private

Removes element from array, but retain all elements ordered. It's slower than Remove

Parameters
i Index of element to be removed
Returns
Removed element
proto void array< class T >::Swap ( array< T >  other )
private
proto int array< class T >::Copy ( array< T >  from )
private
proto int array< class T >::Init ( init[] )
private
void array< class T >::RemoveItem ( value )
private
void array< class T >::Debug ( )
private

Print all elements in array.

Returns
void
my_array.Debug();
>> "One"
>> "Two"
>> "Three"

References itoa(), PrintString(), and ToString().

int array< class T >::GetRandomIndex ( )
private

Returns a random index of array.

Returns
int Random index of array
Print( my_array.GetRandomIndex() );
>> 2

References random().

T array< class T >::GetRandomElement ( )
private

Returns a random element of array.

Returns
int Random element of array
Print( my_array.GetRandomElement() );
>> "Three"
void array< class T >::SwapItems ( int  item1_index,
int  item2_index 
)
private

The documentation for this class was generated from the following file:
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)