2.2 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.
See SystemManager.java for the full implementation.
Constructors
Default constructor
public SystemManager(){}
Methods
entityDestroyed
protected void entityDestroyed(int entity);
Signals the SystemManager that an entity was destroyed. Removes the entity from each system's tracked entities
entitySignatureChanged
protected void entityRegistrationsChanged(int entity, BitSet entityRegistrations);
Signals the SystemManager that an entity had its registrations changed; iterates through each system validating the entities list
registerSystem
protected boolean registerSystem(Type systemType, ECSSystem system);
Registers the specified system name and system reference to this manager.
adds a systemType:system
pair to systems
adds a systemType:new BitSet()
pair to registrationSignatures
setSignature
protected void setRegistrationSignature(Type systemType, BitSet registrations);
Sets the registrations the system requires
Fields
registrationSignatures
private Map<Type, BitSet> registrationSignatures = new HashMap<>()
The mapped list of required registrations
systems
private Map<Type, ECSSystem> systems = new HashMap<>();
The mapped list of system instances