ecs v0.0.5 ECS.Entity
Functions to work with entities.
An entity is an agent-based container for a map of components.
Examples
# Create a monster entity.
monster = ECS.Entity.new([
Component.Health.new(100),
Component.Name.new('monster')
])
# Attach an attack component to the monster.
ECS.Entity.attach(monster, Component.Attack.new(:melee, 24))
Summary
Functions
Attaches a component
to an entity
Detaches a component of type cmp_type
from an entity
Retrieves a component of type cmp_type
from an entity
Checks whether an entity
has a component of cmp_type
Checks whether entity
has component types cmp_types
Returns a new agent pid wrapping components
as a map
Sets entity
component of cmp_type
to value
Updates entity
using fun