ecs v0.0.2 ECS.Routine behaviour
Functions to setup and control routines.
A routine iterates over entities with certain components, and perform
s an
action with them.
Examples
# Define a routine to display entities' names.
defmodule Routine.DisplayNames do
# Accepts entities with a name component.
def accepts?(entity) do
ECS.Entity.has?(:name)
end
# Displays the entity's name
def perform(entity) do
IO.puts ECS.Entity.get(entity, :name)
end
end
Summary
Functions
Run routines
over entities