|
MiniECS
|
This library aims to provide a reasonable basic level of Entity, Component, and Systems ***(ECS)*** functionality.
ECS refers to an architecture where specific Systems operate on a collection of Entities, filtered to match only the Component types the System cares about. In a high-level sense, this transforms a potentially narly-looking inheritance structure down into a Database-like structure.
In this library, entities and components are stored in a collection referred to as an ***ecsWorld***, allowing run-time manipulation and access.
Requires C++17 and CMake. Compiles on GCC 8/9, Clang 7/8/9, MSVC 14/19 (VS 2017/2019). Across this library and other of my "Mini" libraries, the namespace "mini" must be used.
This library exposes the following structures to the user:
An ***ecsComponent*** is what users should sub-class when creating their own components. Using a database analogy, these would be presented as columns.
Example:
An ***ecsEntity*** represents a single entity, but requires no further subclassing or modification from the user under an ECS architecture. All behaviour is expressed in systems responding to the presence or absence of component combinations within an entity. Using a database analogy, these would be presented as rows.
Example: An entity can be made with a set of components representing a player, such as:
An ***ecsHandle*** is a structure used to uniquely identify entities or components using a 32 character UUID. The ecsWorld takes care to provide sensible values on behalf othe user when generating entities and components. However, this class on its own should never have to be used by a user. Instead, when a entity or component is created, its EntityHandle or ComponentHandle will be returned - subclasses of ecsHandle.
Example:
An ***ecsSystem*** provides the logic appropriate to entity-component combinations. These are set to filter certain combinations of components per-entity, and can also optionally accept components. In a database analogy, these would be represented as queries.
Example:
An ***ecsWorld*** stores, organizes, and provides means of accessing and manipulating entities and components. In addition, it facilitates creation of entities and components. It encapsulates the state of a the game-world. It also provides means for systems to interact with the data within. In a database analogy, this would be a DBMS (database management system).
Example:
1.8.12