dartemis library

Classes

Aspect
An Aspect is used by systems as a matcher against entities, to check if a system is interested in an entity. Aspects define what sort of component types an entity must possess, or not possess.
Bag<E>
Collection type a bit like List but does not preserve the order of its entities, speedwise it is very good, especially suited for games.
Component
All components extend from this class.
ComponentManager
Manages als components of all entities.
ComponentType
The ComponentType handles the internal id and bitmask of a Component.
EntityBag
A Bag that uses a BitSet to manage entities. Results in faster removement of entities.
EntityManager
Manages creation and deletion of every int and gives access to some basic statistcs.
EntityObserver
Interface for EntitySystems and Managers to get informed about changes to the state of an int.
EntityProcessingSystem
A typical entity system. Use this when you need to process entities possessing the provided component types.
EntitySystem
The most raw entity system. It should not typically be used, but you can create your own entity system handling by extending this. It is recommended that you use the other provided entity system implementations.
Generate
Metadata to annotate Managers and EntitySystems to generate code required for Mappers, other Managers and other EntitySystems using dartemis_builder.
GroupManager
If you need to group your entities together, e.g. tanks going into "units" group or explosions into "effects", then use this manager. You must retrieve it using world instance.
IntervalEntityProcessingSystem
If you need to process entities at a certain interval then use this. A typical usage would be to regenerate ammo or health at certain intervals, no need to do that every game loop, but perhaps every 100 ms. or every second.
IntervalEntitySystem
A system that processes entities at a interval in milliseconds. A typical usage would be a collision system or physics system.
Manager
Manager.
Mapper<T extends Component>
High performance component retrieval from entities. Use this wherever you need to retrieve components from entities often and fast.
ObjectPool
Inspired by web.archive.org/web/20121106084117/http://www.dartgamedevs.org/2012/11/free-lists-for-predictable-game.html this class stores objects that are no longer used in the game for later reuse.
OptionalMapper<T extends Component>
Same as Mapper, except the [] operator returns T? instead of T and no getSafe method. For use in combination with Aspect.forOneOf.
PerformanceMeasureWorld
A World which measures performance by measureing elapsed time between calls.
PerformanceStats
Performance statistics for all systems.
PlayerManager
You may sometimes want to specify to which player an entity belongs to.
PooledComponent<T extends Pooled<T>>
All components that should be managed in a ObjectPool must extend this class and have a factory constructor that calls Pooled.of(...) to create a component. By doing so, dartemis can handle the construction of PooledComponents and reuse them when they are no longer needed.
TagManager
If you need to tag any entity, use this. A typical usage would be to tag entities such as "PLAYER", "BOSS" or something that is very unique. An entity can only belong to one tag (0,1) at a time.
TeamManager
Use this class together with PlayerManager.
VoidEntitySystem
This system has an empty aspect so it processes no entities, but it still gets invoked. You can use this system if you need to execute some game logic and not have to concern yourself about aspects or entities.
World
The primary instance for the framework. It contains all the managers.

Mixins

MockComponentManagerMixin
For Testing.
MockEntitySystemMixin
For Testing.
MockManagerMixin
For Testing.
Pooled<T extends Pooled<T>>
Objects of this class can be pooled in the ObjectPool for later reuse.

Typedefs

CreatePooled<T extends Pooled<T>> = T Function()
Create a Pooled object.