Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SortAttribute Class Reference
Inheritance diagram for SortAttribute:
UniqueAttribute UniqueAttribute

Detailed Description

Attribute to mark member variable of class as hint for sorting arrays of objects (both dynamic and static). Supported member types for sorting are int, float, string and object

class SampleObject
{
int m_iMember;
void SampleObject(int i)
{
m_iMember = i;
}
}
void Test()
{
array<ref SampleObject> a = {SampleObject(5), SampleObject(2), SampleObject(7)};
Print("Before:");
foreach (auto o: a) Print(o.m_iMember); // 5,2,7
a.Sort();
Print("After:");
foreach (auto o: a) Print(o.m_iMember); // 2,5,7
}
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.

Definition at line 42 of file SortAttribute.c.


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