module Entitas::IGroup

Included Modules

Direct including types

Defined in:

entitas/interfaces/i_group.cr

Constant Summary

Log = ::Log.for(self)

Instance Method Summary

Instance methods inherited from module Entitas::Helper::Entities(Entitas::IEntity)

count : Int32 count, each(&block : TEntity -> Nil) each, get_entities get_entities, has_entity?(entity : TEntity) : Bool has_entity?, size size, sort(&block : TEntity, TEntity -> U) : Array(TEntity) forall U sort

Instance Method Detail

abstract def get_entities(buff : Enumerable(IEntity)) #

[View source]
abstract def get_single_entity : IEntity | Nil #

[View source]
abstract def handle_entity(entity : IEntity, index : Int32, component : Entitas::IComponent) #

[View source]
abstract def handle_entity(entity : IEntity) : Entitas::Events::GroupChanged #

[View source]
abstract def handle_entity_silently(entity : IEntity) #

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

Will append the &block to the #on_entity_added_event_hooks array

on_entity_added do |event|
  # do something with event
end

def on_entity_added_event_hooks : Array(Proc(Entitas::Events::OnEntityAdded, Nil)) #

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


def on_entity_removed(&block : Entitas::Events::OnEntityRemoved -> Nil) #

Will append the &block to the #on_entity_removed_event_hooks array

on_entity_removed do |event|
  # do something with event
end

def on_entity_removed_event_hooks : Array(Proc(Entitas::Events::OnEntityRemoved, Nil)) #

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


def on_entity_updated(&block : Entitas::Events::OnEntityUpdated -> Nil) #

Will append the &block to the #on_entity_updated_event_hooks array

on_entity_updated do |event|
  # do something with event
end

def on_entity_updated_event_hooks : Array(Proc(Entitas::Events::OnEntityUpdated, Nil)) #

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


def receive_on_entity_added_event(event : Entitas::Events::OnEntityAdded) #

def receive_on_entity_removed_event(event : Entitas::Events::OnEntityRemoved) #

def receive_on_entity_updated_event(event : Entitas::Events::OnEntityUpdated) #

abstract def remove_all_event_handlers #

[View source]
def remove_on_entity_added_hook(hook : Proc(Entitas::Events::OnEntityAdded, Nil)) #

def remove_on_entity_removed_hook(hook : Proc(Entitas::Events::OnEntityRemoved, Nil)) #

def remove_on_entity_updated_hook(hook : Proc(Entitas::Events::OnEntityUpdated, Nil)) #

abstract def update_entity(entity : IEntity, index : Int32, prev_component : Entitas::IComponent | Nil, new_component : Entitas::IComponent | Nil) #

[View source]