System

System contain data required to proper glue EntityManager with Systems. System callbacks:

  • void onUpdate(EntitesData);
  • void onEnable() - called inside system.enable() function
  • void onDisable() - called inside system.disable() function
  • bool onBegin() - called inside manager.begin()
  • void onEnd() - called inside manager.end()
  • void onCreate() - called after registration inside registerSystem function
  • void onDestroy() - called during re-registration and inside manager destructor
  • void onAddEntity(EntitesData) - called for every entity which are assigned to system (by adding new entity or changing its components)
  • void onRemoveEntity(EntitiesData) - called for every entity removed from system update process
  • void onChangeEntity(EntitiesData) - called for every entity which components are changed but it was previously assigned to system
  • void handleEvent(Entity*, Event) - called for every event supported by system

Members

Functions

destroy
void destroy()
Undocumented in source. Be warned that the author may not have intended to support it.
disable
void disable()

Disable system. If actually it is disabled function do nothing.

enable
void enable()

Enable system. If actually it is enabled function do nothing.

enabled
bool enabled()

Check if system is enabled.

id
ushort id()

Get system id.

isAlive
bool isAlive()

Return false if system was unregistered, true otherwise.

name
const(char)[] name()

Get system name.

priority
int priority()

Get system priority.

willExecute
bool willExecute()

Get if system will be executed during current frame. Should be checked after manager.begin(). Its value is setted as result of manager.onBegin() callback.

Structs

EventCaller
struct EventCaller
Undocumented in source.

Variables

jobs
EntityManager.Job[] jobs;
Undocumented in source.
m_add_entity
void* m_add_entity;
Undocumented in source.
m_any_system_caller
EntityManager.SystemCaller* m_any_system_caller;
Undocumented in source.
m_begin
void* m_begin;
Undocumented in source.
m_change_entity
void* m_change_entity;
Undocumented in source.
m_components
ushort[] m_components;

required components

m_create
void* m_create;
Undocumented in source.
m_deinitilize
void* m_deinitilize;
Undocumented in source.
m_destroy
void* m_destroy;
Undocumented in source.
m_disable
void* m_disable;
Undocumented in source.
m_empty
bool m_empty;

is system empty? Empty systems don't update entities, and is called once per update

m_enable
void* m_enable;
Undocumented in source.
m_enabled
bool m_enabled;

should system update and catch events?

m_end
void* m_end;
Undocumented in source.
m_event_callers
EventCaller[] m_event_callers;
Undocumented in source.
m_excluded_components
ushort[] m_excluded_components;

excluded components

m_execute
bool m_execute;

should system be executed in current update?

m_filter_entity
void* m_filter_entity;
Undocumented in source.
m_id
ushort m_id;

system id

m_initialize
void* m_initialize;
Undocumented in source.
m_name
char[] m_name;

system name

m_optional_components
ushort[] m_optional_components;

optional components

m_pass
int m_pass;

system pass index

m_priority
int m_priority;

system priority

m_read_only_components
ushort[] m_read_only_components;
Undocumented in source.
m_readonly_dependencies
ushort[] m_readonly_dependencies;
Undocumented in source.
m_remove_entity
void* m_remove_entity;
Undocumented in source.
m_system_pointer
void* m_system_pointer;

pointer to system implementation

m_update
void* m_update;

workaroud for DMD bug with upper line

m_update_delegate
void delegate() m_update_delegate;
Undocumented in source.
m_writable_components
ushort[] m_writable_components;
Undocumented in source.
m_writable_dependencies
ushort[] m_writable_dependencies;
Undocumented in source.

Meta