Changed descriptions for most files
Brought in-line to the docstrings
This commit is contained in:
@@ -30,19 +30,20 @@ public ECSSystem(){}
|
||||
<br>
|
||||
|
||||
## Methods
|
||||
> These two functions are labelled as abstract (must be implemented) to indicate the type of implementation required.
|
||||
> It is not required to add functionality to them. Parametrised versions can also be added.
|
||||
### init
|
||||
``` java
|
||||
public void init(){}
|
||||
abstract void init();
|
||||
```
|
||||
Functionality that needs to occur at the initialisation of the system should be performed here
|
||||
* `init()` should be called only once, before the system is utilised
|
||||
* An example of the type of call that could be made here is opening a file
|
||||
|
||||
<br>
|
||||
|
||||
### update
|
||||
``` java
|
||||
public void update(){}
|
||||
abstract void update();
|
||||
```
|
||||
Functionality that needs to be called regularly should be defined here
|
||||
* `update()` is intended to be called regularly
|
||||
|
||||
@@ -18,63 +18,68 @@ 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(){}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## Methods
|
||||
|
||||
### entityDestroyed
|
||||
``` java
|
||||
public void entityDestroyed(int entity);
|
||||
protected void entityDestroyed(int entity);
|
||||
```
|
||||
Removes the specified entity from every system, if it was associated
|
||||
Signals the SystemManager that an entity was destroyed. Removes the entity from each system's tracked entities
|
||||
|
||||
<br>
|
||||
|
||||
### entitySignatureChanged
|
||||
``` java
|
||||
public void entitySignatureChanged(int entity, BitSet entitySignature);
|
||||
protected void entityRegistrationsChanged(int entity, BitSet entityRegistrations);
|
||||
```
|
||||
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.
|
||||
Signals the SystemManager that an entity had its registrations changed; iterates through each system validating the entities list
|
||||
|
||||
<br>
|
||||
|
||||
### registerSystem
|
||||
``` java
|
||||
public boolean registerSystem(String systemName, ECSSystem system);
|
||||
protected boolean registerSystem(Type systemType, ECSSystem system);
|
||||
```
|
||||
Registers the specified system name and system reference to this manager.
|
||||
|
||||
*adds a `systemName:system` pair to [systems](#systems)*
|
||||
*adds a `systemType:system` pair to [systems](#systems)*
|
||||
|
||||
*and a `systemName:new BitSet()` pair to [signatures](#signatures)*
|
||||
*adds a `systemType:new BitSet()` pair to [registrationSignatures](#registrationSignatures)*
|
||||
|
||||
<br>
|
||||
|
||||
### setSignature
|
||||
``` java
|
||||
public void setSignature(String system, BitSet registrations);
|
||||
protected void setRegistrationSignature(Type systemType, BitSet registrations);
|
||||
```
|
||||
Sets the required signature of the `system`
|
||||
Sets the registrations the system requires
|
||||
|
||||
<br>
|
||||
|
||||
## Fields
|
||||
### signatures
|
||||
### registrationSignatures
|
||||
``` java
|
||||
Map<String, BitSet> signatures = new HashMap<>();
|
||||
private Map<Type, BitSet> registrationSignatures = new HashMap<>()
|
||||
```
|
||||
The mapped list of required registrations
|
||||
|
||||
<br>
|
||||
|
||||
### systems
|
||||
``` java
|
||||
Map<String, ECSSystem> systems = new HashMap<>();
|
||||
private Map<Type, ECSSystem> systems = new HashMap<>();
|
||||
```
|
||||
The mapped list of system instances
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
+8
-5
@@ -1,7 +1,10 @@
|
||||
*| [JavaECS](../README.md) | [docs](../overview.md) | system*
|
||||
# Overview
|
||||
| **In this folder** |
|
||||
|-|
|
||||
| [ECSSystem.md](./ECSSystem.md) |
|
||||
| [System.md](./System.md) |
|
||||
| [SystemManager.md](./SystemManager.md) |
|
||||
### In this folder
|
||||
* [ECSSystem.md](./ECSSystem.md)
|
||||
* [System.md](./System.md)
|
||||
* [SystemManager.md](./SystemManager.md)
|
||||
|
||||
### See source files:
|
||||
* [ECSSystem.java](/BrychanD/JavaECS/src/branch/master/javaecs/src/main/java/nz/ac/massey/javaecs/ECSSystem.java)
|
||||
* [SystemManager.java](/BrychanD/JavaECS/src/branch/master/javaecs/src/main/java/nz/ac/massey/javaecs/SystemManager.java)
|
||||
Reference in New Issue
Block a user