*| [JavaECS](../../README.md) | [docs](../overview.md) | [system](./dir.md) | SystemManager[]().md* # System Manager | **In this Section** | |-| | [About](#about) | | [Implementation](#implementation) | | [Constructors](#constructors) | | [Methods](#methods) | | [Fields](#fields) | | [Examples](#examples)| | [Notes](#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](./ECSSystem.md). Using the object reference, a system can be invoked at any time. See [SystemManager.java](/BrychanD/JavaECS/src/branch/master/javaecs/src/main/java/nz/ac/massey/javaecs/SystemManager.java) for the full implementation. ## Constructors Default constructor ``` java public SystemManager(){} ```
## Methods ### entityDestroyed ``` java protected void entityDestroyed(int entity); ``` Signals the SystemManager that an entity was destroyed. Removes the entity from each system's tracked entities
### entitySignatureChanged ``` java 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 ``` java 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](#systems)* *adds a `systemType:new BitSet()` pair to [registrationSignatures](#registrationSignatures)*
### setSignature ``` java protected void setRegistrationSignature(Type systemType, BitSet registrations); ``` Sets the registrations the system requires
## Fields ### registrationSignatures ``` java private Map registrationSignatures = new HashMap<>() ``` The mapped list of required registrations
### systems ``` java private Map systems = new HashMap<>(); ``` The mapped list of system instances