class Ecs::ComponentRegistry

Overview

Manager class which tracks Components and which Entities they've been added to.

Defined in:

ecs.cr

Instance Method Summary

Instance Method Detail

def attach(entity : Entity, component : Component) #

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.


[View source]
def having(components : Set(Component.class)) : Set(Entity) #

Returns an Enumerable over all Entities which have the given Set of Components.


[View source]
def query : HashSetQuery(Component, Entity) #

Returns a HashSetQuery object for arbitrary filtering


[View source]
def register(component_class : Component.class) #

Register a new Component class


[View source]