module

Entitas::IEntity

Constants

Log = ::Log.for(self)

Instance methods

add_component(index : Int32, component : Entitas::IComponent)
Source
add_component(component : Entitas::IComponent) : Entitas::IComponent
Source
aerc
Source
component_index(index) : Entitas::Component::Index
Source
component_index_class(index) : Entitas::Component::ComponentTypes
Source
component_index_value(index) : Int32
Source
component_pools
Source
context_info
Source
create_component(_type : Entitas::Component::ComponentTypes, **args)
Source
create_component(index : Entitas::Component::Index, **args)
Source
creation_index
Source
destroy!
Source
enabled?

The context manages the state of an entity. Active entities are enabled, destroyed entities are not.

Source
get_component(index : Int32)

Will return the Entitas::Component at the provided index. You can only get a component at an index if it exists.

Source
get_component_indices

Returns all indices of added components.

Source
get_components
Source
has_any_component?(indices : Enumerable(Int32)) : Bool

Determines whether this entity has a component at any of the specified indices.

Source
has_component?(index : Int32) : Bool

Determines whether this entity has a component at the specified index.

Source
has_component?(index : Entitas::Component::Index) : Bool
Source
has_components?(indices : Enumerable(Int32)) : Bool

Determines whether this entity has components at all the specified indices.

Source
internal_destroy!

This method is used internally. Don't call it yourself. use destroy

Source
on_component_added

Will append the &block to the #on_component_added_event_hooks array

on_component_added do |event|
  # do something with event
end
on_component_added_event_hooks

Array of event hooks to trigger when an Entitas::Events::OnComponentAdded is emitted

on_component_removed

Will append the &block to the #on_component_removed_event_hooks array

on_component_removed do |event|
  # do something with event
end
on_component_removed_event_hooks

Array of event hooks to trigger when an Entitas::Events::OnComponentRemoved is emitted

on_component_replaced

Will append the &block to the #on_component_replaced_event_hooks array

on_component_replaced do |event|
  # do something with event
end
on_component_replaced_event_hooks

Array of event hooks to trigger when an Entitas::Events::OnComponentReplaced is emitted

on_destroy_entity

Will append the &block to the #on_destroy_entity_event_hooks array

on_destroy_entity do |event|
  # do something with event
end
on_destroy_entity_event_hooks

Array of event hooks to trigger when an Entitas::Events::OnDestroyEntity is emitted

on_entity_created

Will append the &block to the #on_entity_created_event_hooks array

on_entity_created do |event|
  # do something with event
end
on_entity_created_event_hooks

Array of event hooks to trigger when an Entitas::Events::OnEntityCreated is emitted

on_entity_destroyed

Will append the &block to the #on_entity_destroyed_event_hooks array

on_entity_destroyed do |event|
  # do something with event
end
on_entity_destroyed_event_hooks

Array of event hooks to trigger when an Entitas::Events::OnEntityDestroyed is emitted

on_entity_released

Will append the &block to the #on_entity_released_event_hooks array

on_entity_released do |event|
  # do something with event
end
on_entity_released_event_hooks

Array of event hooks to trigger when an Entitas::Events::OnEntityReleased is emitted

on_entity_will_be_destroyed

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
on_entity_will_be_destroyed_event_hooks

Array of event hooks to trigger when an Entitas::Events::OnEntityWillBeDestroyed is emitted

on_group_created

Will append the &block to the #on_group_created_event_hooks array

on_group_created do |event|
  # do something with event
end
on_group_created_event_hooks

Array of event hooks to trigger when an Entitas::Events::OnGroupCreated is emitted

reactivate(creation_index : Int32, context_info : Entitas::Context::Info)
Source
reactivate(creation_index : Int32)
Source
receive_on_component_added_event(event : Entitas::Events::OnComponentAdded)
receive_on_component_removed_event(event : Entitas::Events::OnComponentRemoved)
receive_on_component_replaced_event(event : Entitas::Events::OnComponentReplaced)
receive_on_destroy_entity_event(event : Entitas::Events::OnDestroyEntity)
receive_on_entity_created_event(event : Entitas::Events::OnEntityCreated)
receive_on_entity_destroyed_event(event : Entitas::Events::OnEntityDestroyed)
receive_on_entity_released_event(event : Entitas::Events::OnEntityReleased)
receive_on_entity_will_be_destroyed_event(event : Entitas::Events::OnEntityWillBeDestroyed)
receive_on_group_created_event(event : Entitas::Events::OnGroupCreated)
release(owner)
Source
remove_all_components!

Removes all components.

Source
remove_all_on_entity_released_handlers
Source
remove_component(index : Int32)
Source
remove_component(index : Entitas::Component::Index) : Nil
Source
remove_on_component_added_hook(hook : Proc(Entitas::Events::OnComponentAdded, Nil))
remove_on_component_removed_hook(hook : Proc(Entitas::Events::OnComponentRemoved, Nil))
remove_on_component_replaced_hook(hook : Proc(Entitas::Events::OnComponentReplaced, Nil))
remove_on_destroy_entity_hook(hook : Proc(Entitas::Events::OnDestroyEntity, Nil))
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_released_hook(hook : Proc(Entitas::Events::OnEntityReleased, 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))
replace_component(index : Int32, component : Entitas::IComponent | Nil)
Source
replace_component(index : Entitas::Component::Index, component : Entitas::IComponent | Nil)
Source
replace_component(component : Entitas::IComponent | Nil)
Source
retain_count
Source
retained_by?(owner)
Source
total_components

The total amount of components an entity can possibly have.

Source