diff --git a/docs/component/component.md b/docs/component/component.md index 4d547a0..6e06737 100644 --- a/docs/component/component.md +++ b/docs/component/component.md @@ -1,4 +1,6 @@ +*[JavaECS](../../README.md) / [docs](../overview.md) / component* # Component + ### Contents [About](#About) diff --git a/docs/entity/entity.md b/docs/entity/entity.md index 4580621..6c3f163 100644 --- a/docs/entity/entity.md +++ b/docs/entity/entity.md @@ -1,4 +1,6 @@ +*[JavaECS](../../README.md) / [docs](../overview.md) / entity* # Entity + ### Contents [About](#About) @@ -26,6 +28,9 @@ ___An entity contains no further data.___ In order to be useful, its identifier must be registered to one or more [components](../component/component.md). + +Entities are also initialised with a Java [BitSet](). Each bit represents the index of a component, to determine which component an entity is registered to + ## Usage *some specific usage info here* ``` java @@ -35,3 +40,4 @@ 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. +* LinkedList is used to initialise the arrays, as a linked list is not limited to a maximum size: (https://stackoverflow.com/questions/3767979/how-much-data-can-a-list-can-hold-at-the-maximum) diff --git a/docs/overview.md b/docs/overview.md new file mode 100644 index 0000000..da644cb --- /dev/null +++ b/docs/overview.md @@ -0,0 +1,16 @@ +*[JavaECS](../../README.md) / docs* +# Entity +### Contents +[About](#About) + +[Usage](#Usage) + +[Notes](#Notes) + +### See also: +[entity](./entity/entity.md) + +[component](./component/component.md) + +[system](./system/system.md) + diff --git a/docs/system/system.md b/docs/system/system.md index 7ef9fe1..c5c6c56 100644 --- a/docs/system/system.md +++ b/docs/system/system.md @@ -1,7 +1,13 @@ +*[JavaECS](../../README.md) / [docs](../overview.md) / system* # System + ### Contents [About](#About) +[Implementation](#Implementation) + +[Examples](#Examples) + ## About The system runs operations that must be performed on its assoiciated components. @@ -20,5 +26,22 @@ void health_system(){ } } ``` +## Implementation + +The systems are managed by the following code: + +``` java +class SystemManager{ + ECS baseECS; + int systemIndex; + + public SystemManager(ECS baseECS){ + this.baseECS = baseECS; + systemIndex = 0; + } +} +``` + +## Examples