module Entitas::IContext
Direct including types
Defined in:
entitas/interfaces/i_context.crConstant Summary
-
Log =
::Log.for(self)
Instance Method Summary
- #add_entity_index(entity_index : Entitas::IEntityIndex)
- #clear_component_pool(index : Int32)
- #clear_component_pools
- #component_index(index) : Entitas::Component::Index
- #component_index_class(index) : Entitas::Component::ComponentTypes
- #component_index_value(index) : Int32
- #component_pools : Array(Entitas::ComponentPool)
- #create_entity : IEntity
- #destroy_all_entities
- #each(&block : TEntity -> Nil)
- #entity_factory : Entitas::Entity
- #get_entities
- #get_entity_index(name : String) : Entitas::IEntityIndex
- #get_entity_index?(name : String) : Entitas::IEntityIndex | Nil
- #get_group(matcher : Entitas::Matcher) : Entitas::Group
- #has_entity?(entity : TEntity) : Bool
-
#on_entity_created(&block : Entitas::Events::OnEntityCreated -> Nil)
Will append the
&block
to the#on_entity_created_event_hooks
array -
#on_entity_created_event_hooks : Array(Proc(Entitas::Events::OnEntityCreated, Nil))
Array of event hooks to trigger when an
Entitas::Events::OnEntityCreated
is emitted -
#on_entity_destroyed(&block : Entitas::Events::OnEntityDestroyed -> Nil)
Will append the
&block
to the#on_entity_destroyed_event_hooks
array -
#on_entity_destroyed_event_hooks : Array(Proc(Entitas::Events::OnEntityDestroyed, Nil))
Array of event hooks to trigger when an
Entitas::Events::OnEntityDestroyed
is emitted -
#on_entity_will_be_destroyed(&block : Entitas::Events::OnEntityWillBeDestroyed -> Nil)
Will append the
&block
to the#on_entity_will_be_destroyed_event_hooks
array -
#on_entity_will_be_destroyed_event_hooks : Array(Proc(Entitas::Events::OnEntityWillBeDestroyed, Nil))
Array of event hooks to trigger when an
Entitas::Events::OnEntityWillBeDestroyed
is emitted -
#on_group_created(&block : Entitas::Events::OnGroupCreated -> Nil)
Will append the
&block
to the#on_group_created_event_hooks
array -
#on_group_created_event_hooks : Array(Proc(Entitas::Events::OnGroupCreated, Nil))
Array of event hooks to trigger when an
Entitas::Events::OnGroupCreated
is emitted - #receive_on_entity_created_event(event : Entitas::Events::OnEntityCreated)
- #receive_on_entity_destroyed_event(event : Entitas::Events::OnEntityDestroyed)
- #receive_on_entity_will_be_destroyed_event(event : Entitas::Events::OnEntityWillBeDestroyed)
- #receive_on_group_created_event(event : Entitas::Events::OnGroupCreated)
- #remove_all_event_handlers
- #remove_on_entity_created_hook(hook : Proc(Entitas::Events::OnEntityCreated, Nil))
- #remove_on_entity_destroyed_hook(hook : Proc(Entitas::Events::OnEntityDestroyed, Nil))
- #remove_on_entity_will_be_destroyed_hook(hook : Proc(Entitas::Events::OnEntityWillBeDestroyed, Nil))
- #remove_on_group_created_hook(hook : Proc(Entitas::Events::OnGroupCreated, Nil))
- #reset
- #reset_creation_index
- #size
- #to_json(json : JSON::Builder)
- #total_components : Int32
Instance Method Detail
Will append the &block
to the #on_entity_created_event_hooks
array
on_entity_created do |event|
# do something with event
end
Array of event hooks to trigger when an Entitas::Events::OnEntityCreated
is emitted
Will append the &block
to the #on_entity_destroyed_event_hooks
array
on_entity_destroyed do |event|
# do something with event
end
Array of event hooks to trigger when an Entitas::Events::OnEntityDestroyed
is emitted
Will append the &block
to the #on_entity_will_be_destroyed_event_hooks
array
on_entity_will_be_destroyed do |event|
# do something with event
end
Array of event hooks to trigger when an Entitas::Events::OnEntityWillBeDestroyed
is emitted
Will append the &block
to the #on_group_created_event_hooks
array
on_group_created do |event|
# do something with event
end
Array of event hooks to trigger when an Entitas::Events::OnGroupCreated
is emitted