module Entitas::IContext

Direct including types

Defined in:

entitas/interfaces/i_context.cr

Constant Summary

Log = ::Log.for(self)

Instance Method Summary

Instance Method Detail

abstract def add_entity_index(entity_index : Entitas::IEntityIndex) #

[View source]
abstract def clear_component_pool(index : Int32) #

[View source]
abstract def clear_component_pools #

[View source]
abstract def component_index(index) : Entitas::Component::Index #

[View source]
abstract def component_index_class(index) : Entitas::Component::ComponentTypes #

[View source]
abstract def component_index_value(index) : Int32 #

[View source]
abstract def component_pools : Array(Entitas::ComponentPool) #

[View source]
abstract def create_entity : IEntity #

[View source]
abstract def destroy_all_entities #

[View source]
abstract def each(&block : TEntity -> Nil) #

[View source]
abstract def entity_factory : Entitas::Entity #

[View source]
abstract def get_entities #

[View source]
abstract def get_entity_index(name : String) : Entitas::IEntityIndex #

[View source]
abstract def get_entity_index?(name : String) : Entitas::IEntityIndex | Nil #

[View source]
abstract def get_group(matcher : Entitas::Matcher) : Entitas::Group #

[View source]
abstract def has_entity?(entity : TEntity) : Bool #

[View source]
def on_entity_created(&block : Entitas::Events::OnEntityCreated -> Nil) #

Will append the &block to the #on_entity_created_event_hooks array

on_entity_created do |event|
  # do something with event
end

def on_entity_created_event_hooks : Array(Proc(Entitas::Events::OnEntityCreated, Nil)) #

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


def on_entity_destroyed(&block : Entitas::Events::OnEntityDestroyed -> Nil) #

Will append the &block to the #on_entity_destroyed_event_hooks array

on_entity_destroyed do |event|
  # do something with event
end

def on_entity_destroyed_event_hooks : Array(Proc(Entitas::Events::OnEntityDestroyed, Nil)) #

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


def 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 do |event|
  # do something with event
end

def 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


def on_group_created(&block : Entitas::Events::OnGroupCreated -> Nil) #

Will append the &block to the #on_group_created_event_hooks array

on_group_created do |event|
  # do something with event
end

def on_group_created_event_hooks : Array(Proc(Entitas::Events::OnGroupCreated, Nil)) #

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


def receive_on_entity_created_event(event : Entitas::Events::OnEntityCreated) #

def receive_on_entity_destroyed_event(event : Entitas::Events::OnEntityDestroyed) #

def receive_on_entity_will_be_destroyed_event(event : Entitas::Events::OnEntityWillBeDestroyed) #

def receive_on_group_created_event(event : Entitas::Events::OnGroupCreated) #

abstract def remove_all_event_handlers #

[View source]
def remove_on_entity_created_hook(hook : Proc(Entitas::Events::OnEntityCreated, Nil)) #

def remove_on_entity_destroyed_hook(hook : Proc(Entitas::Events::OnEntityDestroyed, Nil)) #

def remove_on_entity_will_be_destroyed_hook(hook : Proc(Entitas::Events::OnEntityWillBeDestroyed, Nil)) #

def remove_on_group_created_hook(hook : Proc(Entitas::Events::OnGroupCreated, Nil)) #

abstract def reset #

[View source]
abstract def reset_creation_index #

[View source]
abstract def size #

[View source]
abstract def to_json(json : JSON::Builder) #

[View source]
abstract def total_components : Int32 #

[View source]