Types
ArchetypeId = distinct BiggestInt
EntityIndex = object entityId*: EntityId archetype*: ArchetypeId archetypeIndex*: uint
NewEntity = distinct ptr EntityIndex
World = object
- Contains the data describing the entire world
Procs
proc `[]`(world: World; entityId: EntityId): ptr EntityIndex {....raises: [], tags: [], forbids: [].}
- Look up entity information based on an entity ID
proc del(world: var World; entityId: EntityId): Option[EntityIndex] {. ...raises: [], tags: [], forbids: [].}
- Deletes an entity and returns the archetype and index that also needs to be deleted
proc getNewEntityId(world: var World): EntityId {.inline, ...raises: [], tags: [], forbids: [].}
proc setArchetypeDetails(entry: NewEntity; archetype: ArchetypeId; index: uint) {. ...raises: [], tags: [], forbids: [].}
- Stores the archetype details about an entity