View Source ow_ecs2 (overworld v2.0.0)

Summary

Types

-type component() :: {term(), term()}.
-type entity() :: {term(), [component()]}.
-type id() :: integer().
-type system() :: {mfa() | fun()}.
-opaque world()

Functions

Link to this function

add_component(Name, Data, EntityID, World)

View Source
-spec add_component(term(), term(), id(), world()) -> ok.
Link to this function

add_components(Components, EntityID, World)

View Source
-spec add_components([{term(), term()}], id(), world()) -> ok.
Link to this function

add_system(Callback, World)

View Source
-spec add_system(system(), world()) -> {ok, world()}.
Link to this function

add_system(Callback, Priority, World)

View Source
-spec add_system(system(), integer(), world()) -> {ok, world()}.
Link to this function

del_component(Name, EntityID, World)

View Source
-spec del_component(term(), id(), world()) -> ok.
Link to this function

del_components(Components, EntityID, World)

View Source
-spec del_components([term()], id(), world()) -> ok.
Link to this function

del_system(Callback, World)

View Source
-spec del_system(system(), world()) -> {ok, world()}.
-spec entities(world()) -> [{id(), [term()]}].
-spec entity(id(), world()) -> {id(), [term()]} | false.
Link to this function

foreach_component(Fun, Component, World)

View Source
-spec foreach_component(fun(), term(), world()) -> ok.
Link to this function

get(Component, ComponentList)

View Source
-spec get(term(), [component()]) -> term().
Link to this function

get(Component, ComponentList, Default)

View Source
-spec get(term(), [component()], term()) -> term().
Link to this function

match_component(ComponentName, World)

View Source
-spec match_component(term(), world()) -> [entity()].
Link to this function

match_components(List, World)

View Source
-spec match_components([term()], world()) -> [entity()].
Link to this function

new_entity(EntityID, World)

View Source
-spec new_entity(id(), world()) -> ok.
-spec proc(world()) -> any().
-spec proc(any(), world()) -> [any()].
Link to this function

rm_entity(EntityID, World)

View Source
-spec rm_entity(id(), world()) -> ok.
-spec start() -> world().
-spec stop(world()) -> ok.
Link to this function

take(Component, ComponentList)

View Source
-spec take(term(), [component()]) -> term() | false.
Link to this function

take(Component, ComponentList, Default)

View Source
-spec take(term(), [component()], term()) -> {term(), [term()]} | term().
-spec to_map(entity()) -> map().
Link to this function

try_component(ComponentName, EntityID, World)

View Source
-spec try_component(term(), id(), world()) -> {ok, [term()]} | false.