JavaECS-Docs/docs/system/SystemManager.md
Brychan Dempsey 7b09b13889 Added System docs
Improved the accuracy of system.md
Added ECSSystem.md and SystemManager.md
2021-06-05 15:40:56 +12:00

1.8 KiB

| JavaECS | docs | system | SystemManager.md

System Manager

In this section

About

Implementation

Constructors

Methods

Fields

Examples

Notes

About

The system manager class controls references to the systems.

Implementation

Before attempting to use a system, it must be registered.

Registration requires a call to registerSystem(String systemName, ECSSystem system), with params of the String name and a object reference of the ECSSystem. Using the object reference, a system can be invoked at any time.

Constructors

Default constructor

public SystemManager(){}

Methods

entityDestroyed

public void entityDestroyed(int entity);

Removes the specified entity from every system, if it was associated


entitySignatureChanged

public void entitySignatureChanged(int entity, BitSet entitySignature);

Checks the entity's new signature against the current registrations. Registers the entity if it wasn't previously registered, or removes it if it is no longer registered.


registerSystem

public boolean registerSystem(String systemName, ECSSystem system);

Registers the specified system name and system reference to this manager.

adds a systemName:system pair to systems

and a systemName:new BitSet() pair to signatures


setSignature

public void setSignature(String system, BitSet registrations);

Sets the required signature of the system


Fields

signatures

Map<String, BitSet> signatures = new HashMap<>();

systems

Map<String, ECSSystem> systems = new HashMap<>();