Package nz.ac.massey.javaecs
Class SystemManager
- java.lang.Object
-
- nz.ac.massey.javaecs.SystemManager
-
public class SystemManager extends Object
Manages system-focused aspects, such as ensuring a system has the correct list of current entities. Manages registration of new systems
-
-
Constructor Summary
Constructors Constructor Description SystemManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
entityDestroyed(Entity entity)
Signals the SystemManager that an entity was destroyed.void
entityRegistrationsChanged(Entity entity, BitSet entityRegistrations)
Signals the SystemManager that an entity had its registrations changed, so evaluate if the entity is still relevant to each system.boolean
registerSystem(Type systemType, ECSSystem system)
Registers the specified system name and system referencevoid
setSystemRegistraions(Type systemType, BitSet registrations)
Sets the registrations the system requires
-
-
-
Method Detail
-
entityDestroyed
protected void entityDestroyed(Entity entity)
Signals the SystemManager that an entity was destroyed. Removes the entity from each system's tracked entities- Parameters:
entity
- the destroyed entity
-
entityRegistrationsChanged
public void entityRegistrationsChanged(Entity entity, BitSet entityRegistrations)
Signals the SystemManager that an entity had its registrations changed, so evaluate if the entity is still relevant to each system.- Parameters:
entity
- the entity that was modifiedentityRegistrations
- the new registrations of the entity
-
registerSystem
public boolean registerSystem(Type systemType, ECSSystem system)
Registers the specified system name and system reference- Parameters:
systemType
- the class type of the systemsystem
- the instance of the system- Returns:
- true if the system was added successfully. False if it was already registered; with an error message written to the log
-
-