2021-06-05 15:40:56 +12:00
|
|
|
*| [JavaECS](../../README.md) | [docs](../overview.md) | [system](./dir.md) | ECSSystem[]().md*
|
2021-06-05 15:57:25 +12:00
|
|
|
# ECS System
|
2021-06-05 15:40:56 +12:00
|
|
|
|
2021-06-05 15:57:25 +12:00
|
|
|
| **In this Section** |
|
|
|
|
|-|
|
|
|
|
| [About](#about) |
|
|
|
|
| [Implementation](#implementation) |
|
|
|
|
| [Constructors](#constructors) |
|
|
|
|
| [Methods](#methods) |
|
|
|
|
| [Fields](#fields) |
|
2021-06-05 15:40:56 +12:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## About
|
2021-06-05 15:57:25 +12:00
|
|
|
The `ECSSystem` class is intended to be extended by a more specific system implementation.
|
|
|
|
|
|
|
|
<br>
|
2021-06-05 15:40:56 +12:00
|
|
|
|
|
|
|
## Implementation
|
2021-06-05 15:43:27 +12:00
|
|
|
See [System.md](./System.md#implementation)
|
2021-06-05 15:57:25 +12:00
|
|
|
|
|
|
|
<br>
|
|
|
|
|
2021-06-05 15:40:56 +12:00
|
|
|
## Constructors
|
|
|
|
Default constructor
|
|
|
|
``` java
|
|
|
|
public ECSSystem(){}
|
|
|
|
```
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
## Methods
|
2021-06-08 21:13:34 +12:00
|
|
|
> 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.
|
2021-06-05 15:40:56 +12:00
|
|
|
### init
|
|
|
|
``` java
|
2021-06-08 21:13:34 +12:00
|
|
|
abstract void init();
|
2021-06-05 15:40:56 +12:00
|
|
|
```
|
|
|
|
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
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
### update
|
|
|
|
``` java
|
2021-06-08 21:13:34 +12:00
|
|
|
abstract void update();
|
2021-06-05 15:40:56 +12:00
|
|
|
```
|
|
|
|
Functionality that needs to be called regularly should be defined here
|
|
|
|
* `update()` is intended to be called regularly
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
## Fields
|
|
|
|
### entities
|
|
|
|
``` java
|
|
|
|
Set<Integer> entities = new HashSet<>();
|
|
|
|
```
|
|
|
|
The list of entities associated with this system
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
## Notes
|