ETHEntityArray /Core objects

This object encapsulates an array of entity handles. The GetEntityArray function can be used to build custom arrays from entities in scene.

Example:

ETHEntityArray soldiers;

void StartGame()
{
    // gets the handles to each "soldier.ent" in scene
    GetEntityArray("soldier.ent", soldiers);
}

void GameLoop()
{
    const uint numSoldiers = soldiers.Size();

    for (uint t = 0; t < numSoldiers; t++)
    {
        // move each soldier to the right
        soldiers[t].AddToPositionXY(vector2(1.0f, 0.0f));
    }
}

It is also possible to build arrays from buckets. More about scene buckets.

ETHEntityArray ents;

// inserts into ents a list of all entities around the character
GetEntitiesAroundBucket(character.GetCurrentBucket(), ents);
ETHEntityArray bucketArray;

GetEntitiesFromBucket(vector2(1,1), bucketArray);
for (uint t = 0; t < bucketArray.Size(); t++)
{
    bucketArray[t].SetColor(newColor);
}