*| [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. ## Constructors Default constructor ``` java public SystemManager(){} ```
## Methods ### entityDestroyed ``` java public void entityDestroyed(int entity); ``` Removes the specified entity from every system, if it was associated
### entitySignatureChanged ``` java 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 ``` java 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](#systems)* *and a `systemName:new BitSet()` pair to [signatures](#signatures)*
### setSignature ``` java public void setSignature(String system, BitSet registrations); ``` Sets the required signature of the `system`
## Fields ### signatures ``` java Map signatures = new HashMap<>(); ```
### systems ``` java Map systems = new HashMap<>(); ```