class Ecs::ComponentRegistry
- Ecs::ComponentRegistry
- Reference
- Object
Overview
Manager class which tracks Components and which Entities they've been added to.
Defined in:
ecs.crInstance Method Summary
-
#attach(entity : Entity, component : Component)
Attaches the given Component to the given Entity.
-
#having(components : Set(Component.class)) : Set(Entity)
Returns an Enumerable over all Entities which have the given Set of Components.
-
#query : HashSetQuery(Component, Entity)
Returns a HashSetQuery object for arbitrary filtering
-
#register(component_class : Component.class)
Register a new Component class
Instance Method Detail
Attaches the given Component to the given Entity. Note that multiple Entities can share a single instance of a Component, which potentially allows lightweight objects with minimal performance cost and memory usage.
Returns an Enumerable over all Entities which have the given Set of Components.
Returns a HashSetQuery object for arbitrary filtering