Enfusion Script API
Loading...
Searching...
No Matches
SortAttribute Interface Reference

Attribute to mark member variable of class as hint for sorting arrays of objects (both dynamic and static). More...

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.
Attribute to mark member variable of class as hint for sorting arrays of objects (both dynamic and st...
Definition: attributes.c:519
Attribute used for tests annotation and assignment to Suites.
Definition: TestingFramework.c:97
Definition: Types.c:150

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