Arma Reforger Script API
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
SCR_ArrayHelperT< Class T > Interface Template Reference

T being the array ITEM class, not the full array<item> In the case of references, simply use SCR_ArrayHelperT<OtherClass>, not SCR_ArrayHelperT<ref OtherClass> Some methods may seem duplicated but they are actually variants for <T> and <ref T> More...

Static Public Member Functions

static void CopyReferencesFromTo (notnull array< ref T > source, notnull array< ref T > destination)
 Same as array.Copy, but for reference arrays.
 
static array< T > GetCopy (array< T > source)
 
static array< ref T > GetCopy (array< ref T > source)
 
static void Intersect (notnull array< T > array1, notnull array< T > array2, notnull out array< T > result)
 Gets all items that are common to the two arrays.
 
static void Intersect (notnull array< ref T > array1, notnull array< ref T > array2, notnull out array< ref T > result)
 Gets all items that are common to the two arrays.
 
static void RemoveDuplicates (notnull inout array< T > items)
 Remove duplicates from the array by the righthand side (e.g { "a", "b", "a" } -> { "a", "b" }, not { "b", "a" }.
 
static void RemoveDuplicates (notnull inout array< ref T > items)
 Remove duplicates from the array by the righthand side (e.g { "a", "b", "a" } -> { "a", "b" }, not { "b", "a" }.
 
static void Reverse (notnull inout array< T > items)
 Reverse item orders OBSOLETE when array.Reverse appears.
 
static void Reverse (notnull inout array< ref T > items)
 Reverse item orders OBSOLETE when array.Reverse appears.
 
static void Shuffle (notnull inout array< T > items, int shuffles=1)
 Shuffle an array.
 
static void Shuffle (notnull inout array< ref T > items, int shuffles=1)
 Shuffle an array of references.
 

Detailed Description

T being the array ITEM class, not the full array<item> In the case of references, simply use SCR_ArrayHelperT<OtherClass>, not SCR_ArrayHelperT<ref OtherClass> Some methods may seem duplicated but they are actually variants for <T> and <ref T>

Member Function Documentation

◆ CopyReferencesFromTo()

static void SCR_ArrayHelperT< Class T >.CopyReferencesFromTo ( notnull array< ref T >  source,
notnull array< ref T >  destination 
)
static

Same as array.Copy, but for reference arrays.

See also
GetCopy
Parameters
[in]source
[in]destination

◆ GetCopy() [1/2]

static array< ref T > SCR_ArrayHelperT< Class T >.GetCopy ( array< ref T >  source)
static
Parameters
[in]source
Returns
a copy of values or null if source is null

◆ GetCopy() [2/2]

static array< T > SCR_ArrayHelperT< Class T >.GetCopy ( array< T >  source)
static
Parameters
[in]source
Returns
a copy of refs or null if source is null

◆ Intersect() [1/2]

static void SCR_ArrayHelperT< Class T >.Intersect ( notnull array< ref T >  array1,
notnull array< ref T >  array2,
notnull out array< ref T >  result 
)
static

Gets all items that are common to the two arrays.

Parameters
[in]array1
[in]array2
[out]result

◆ Intersect() [2/2]

static void SCR_ArrayHelperT< Class T >.Intersect ( notnull array< T >  array1,
notnull array< T >  array2,
notnull out array< T >  result 
)
static

Gets all items that are common to the two arrays.

Parameters
[in]array1
[in]array2
[out]result

◆ RemoveDuplicates() [1/2]

static void SCR_ArrayHelperT< Class T >.RemoveDuplicates ( notnull inout array< ref T >  items)
static

Remove duplicates from the array by the righthand side (e.g { "a", "b", "a" } -> { "a", "b" }, not { "b", "a" }.

Parameters
[in,out]items

◆ RemoveDuplicates() [2/2]

static void SCR_ArrayHelperT< Class T >.RemoveDuplicates ( notnull inout array< T >  items)
static

Remove duplicates from the array by the righthand side (e.g { "a", "b", "a" } -> { "a", "b" }, not { "b", "a" }.

Parameters
[in,out]items

◆ Reverse() [1/2]

static void SCR_ArrayHelperT< Class T >.Reverse ( notnull inout array< ref T >  items)
static

Reverse item orders OBSOLETE when array.Reverse appears.

array<int> values = { 2, 42, 33, 0 };
Print(values); // outputs { 0, 33, 42, 2 }
T being the array ITEM class, not the full array<item> In the case of references, simply use SCR_Arra...
Definition: SCR_ArrayHelper.c:62
static void Reverse(notnull inout array< T > items)
Reverse item orders OBSOLETE when array.Reverse appears.
Definition: SCR_ArrayHelper.c:202
Parameters
[in,out]items

◆ Reverse() [2/2]

static void SCR_ArrayHelperT< Class T >.Reverse ( notnull inout array< T >  items)
static

Reverse item orders OBSOLETE when array.Reverse appears.

array<int> values = { 2, 42, 33, 0 };
Print(values); // outputs { 0, 33, 42, 2 }
Parameters
[in,out]items

◆ Shuffle() [1/2]

static void SCR_ArrayHelperT< Class T >.Shuffle ( notnull inout array< ref T >  items,
int  shuffles = 1 
)
static

Shuffle an array of references.

array<ref MyClass> values = { new MyClass(1), new MyClass(2), new MyClass(3), new MyClass(4), new MyClass(5) };
Print(values); // outputs e.g { MyClass(4), MyClass(1), MyClass(5), MyClass(2), MyClass(3) }
static void Shuffle(notnull inout array< T > items, int shuffles=1)
Shuffle an array.
Definition: SCR_ArrayHelper.c:282
Parameters
[in,out]items
[in]shufflesnumber of shuffle passes to happen. min 1, max 10

◆ Shuffle() [2/2]

static void SCR_ArrayHelperT< Class T >.Shuffle ( notnull inout array< T >  items,
int  shuffles = 1 
)
static

Shuffle an array.

array<int> values = { 1, 2, 3, 4, 5 };
Print(values); // outputs e.g { 4, 1, 5, 2, 3 }
Parameters
[in,out]items
[in]shufflesnumber of shuffle passes to happen. min 1, max 10

The documentation for this interface was generated from the following file: