2021-06-03 13:27:53 +12:00

38 lines
1.4 KiB
Markdown

# Entity
### Contents
[About](#About)
[Usage](#Usage)
[Notes](#Notes)
## About
An 'entity' is a unique ID.
For most implementations, it makes sense to use a simple integer value - usually in a packed array (*reuses the most minimal value it can*)
E.g.: The ID 101 would be the next selected value for a new entity.
>100 | 101 | 102| 103| 104| ...|
>:----:|:-----:|:----:|:----:|:----:|:----|
><span style="color:gray">used|unused|<span style="color:gray">used|<span style="color:gray">used| unused| <span style="color:gray">....
<br>
**This ID represents a specific instance of a game object**
e.g. character, vehicle, effect etc.
___An entity contains no further data.___
In order to be useful, its identifier must be registered to one or more [components](././component/component.md).
## Usage
*some specific usage info here*
``` java
void todo();
```
## Notes
* The only requirement for a Entity is that it has a unique ID. An [entity manager](././manager/entity_manager.md) could implement a more complex ID system such as using a packed array for only a small region of IDs, or using named IDs by use of a dictionary or ordered hash-map
* The maximum number of entities is limited by the size of the container used to store it. E.g., for a 32-bit unsigned integer, there are ~4.3 billion ID's available. But keep in mind that such a large amount of IDs will take significant time for each system to consider.