ashd.core.engine

The Engine class is the central point for creating and managing your game state. Add entities and systems to the engine, and fetch families of nodes from the engine.

In essence, a family manages a NodeList. So whenever a System requests a collection of nodes, the engine looks for a family that is managing such a collection. If it doesn't have one, it creates a new one. Either way, it then passes the NodeList managed by the family back to the System that requested it.

The family is initialised with a node type. It uses reflection to determine what components that node type requires. Whenever an entity is added to the engine it is passed to every family in the engine, and the families determine whether that entity has the necessary components to join that family. If it does then the family will add it to its NodeList. If the components on an entity are changed, by adding or removing a component, then again the engine checks with all the families and each family tests whether to add or remove the entity to/from its NodeList. Finally, when an entity is removed form the engine the engine informs all the families and any family that has the entity in its NodeList will remove it.

Members

Classes

Engine
class Engine
Undocumented in source.

Meta