World manages entities, components and services

Variables

read onlyavailable:Int

Count of available entities in pool

read onlycapacity:Int

Maximum amount of entities including invalid/reserved.

Capacity will be rounded to power-of-two value plus one. For requested capacity 3 will be allocated: capacity = nearestPOT(3 - 1) + 1 = 3. For capacity = 5 we have set of valid entities {1, 2, 3, 4} and one invalid is 0

read onlyid:Int

Identifier of this world

read onlyused:Int

Count of alive entities

Methods

activate (entity:Entity):Void

Make entity active

inline checkAlive (entity:Entity):Bool

Check if entity is alive

clone (source:Entity):Entity

Creates active entity and clone data from source entity.

inline commit (entity:Entity):Void

Mark entity as changed

create ():Entity

Return new active entity (which will be marked as changed).

createPassive ():Entity

Returns new passive entity.

deactivate (entity:Entity):Void

Make entity passive

delete (entity:Entity):Void

destroy (entity:Entity):Void

Entity will be destroyed on next world invalidation

destroyComponents (entity:Entity):Void

Destroy all components attached to entity

inline getEntity (id:Int):Entity

Convert integer id to abstract Entity handle.

getObjectSize ():Int

Theoretic memory consuming in bytes

invalidate ():Void

Performs entities destroying, commits and update families

inline isActive (entity:Entity):Bool

Check if entity is active

inline systems ():CArrayIterator_ecx_System

Iterator for active systems ordered by priority

toString ():String