View Source ow_ecs (overworld v2.0.0)

Summary

Types

-type component() :: {term(), term()}.
-type entity() :: {term(), [component()]}.
-type id() :: integer().
-type system() :: {mfa() | fun()}.
-type world() ::
          #world{name :: term(),
                 systems :: [{term(), system()}],
                 entities :: ets:tid(),
                 components :: ets:tid()}.

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(System, World)

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

add_system(System, Priority, World)

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

code_change(OldVsn, State, Extra)

View Source
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(System, World)

View Source
-spec del_system(system(), world()) -> ok.
-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

handle_call(_, From, State)

View Source
Link to this function

handle_info(Info, State)

View Source
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(world(), any()) -> [any()].
Link to this function

rm_entity(EntityID, World)

View Source
-spec rm_entity(id(), 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().
Link to this function

terminate(Reason, State)

View Source
-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.