API

API

World

A collection of entities and their components.

source
ECSComponent

A representation of an entity component system component.

source
EntityKey

A generational index to an entity that will fail in usage if the entity has been destroyed.

source
register!(world::World,::Type{C}) where C <: ECSComponent

Registers storage space for a component type.

source
createentity!(world::World)

Allocates an entity and returns an entity key.

source
getentity(world::World,key::EntityKey)

Returns entity index if entity key is still valid.

source
destroyentity!(world::World,entity::EntityKey)

Deallocates entity and memory if entity key is valid.

source
addcomponent!(world::World,entity::EntityKey,component::C) where C <: ECSComponent

Associate a component with an entity key.

source
removecomponent!(world::World,entity::EntityKey,::Type{C}) where C <: ECSComponent

Dissociate a component of a specific type with an entity key.

source
getcomponent(world::World,entity::EntityKey,::Type{C}) where C <: ECSComponent

Get a component of a specific type of an entity key.

source
runsystem!(f,world::World,types::Array{DataType,1})

For each entity with components of passed in types, call provided function with that entity and components.

source