class Entitas::Systems

Overview

Systems provide a convenient way to group systems. You can add InitializeSystem, ExecuteSystem, CleanupSystem, TearDownSystem, ReactiveSystem and other nested Systems instances. All systems will be initialized and executed based on the order you added them.

Included Modules

Direct Known Subclasses

Defined in:

entitas.cr
entitas/systems.cr

Constant Summary

Log = ::Log.for(self)

Instance Method Summary

Instance methods inherited from module Entitas::Systems::TearDownSystem

tear_down tear_down

Instance methods inherited from module Entitas::System

to_json(json : JSON::Builder) to_json

Instance methods inherited from module Entitas::Systems::InitializeSystem

init init

Instance methods inherited from module Entitas::System

to_json(json : JSON::Builder) to_json

Instance methods inherited from module Entitas::Systems::ExecuteSystem

execute execute

Instance methods inherited from module Entitas::System

to_json(json : JSON::Builder) to_json

Instance methods inherited from module Entitas::Systems::CleanupSystem

cleanup cleanup

Instance methods inherited from module Entitas::System

to_json(json : JSON::Builder) to_json

Instance Method Detail

def <<(sys : Entitas::System) #

Adds the system instance to the systems list.


[View source]
def activate_reactive_systems : Nil #

Activates all ReactiveSystems in the systems list.


[View source]
def add(sys : Entitas::System) : Systems #

Adds the system instance to the systems list.


[View source]
def cleanup : Nil #

Calls #cleanup on all CleanupSystem and other nested Systems instances in the order you added them.


[View source]
def clear_reactive_systems #

Clears all ReactiveSystems in the systems list.


[View source]
def deactivate_reactive_systems : Nil #

Deactivates all ReactiveSystems in the systems list. This will also clear all ReactiveSystems. This is useful when you want to soft-restart your application and want to reuse your existing system instances.


[View source]
def execute : Nil #

Calls #execute on all ExecuteSystem and other nested Systems instances in the order you added them.


[View source]
def find_system(klass : Class) : Entitas::System | Nil #

Recusivly searches for sub systems with the type provided and returns the first match


[View source]
def find_systems(klass : Class) : Array(Entitas::System) #

Recusivly searches for sub systems with the type provided and returns all matches


[View source]
def init : Nil #

Calls #init on all InitializeSystem and other nested Systems instances in the order you added them.


[View source]
def tear_down : Nil #

Calls #tear_down on all TearDownSystem and other nested Systems instances in the order you added them.


[View source]