Home > @gglib/ecs

ecs package

Classes

Class Description
Entity An object that holds a collection of components a collection of services and a collection of child entities.

Functions

Function Description
Component(options) A decorator that adds metadata to a component type to enable some automagic
decorateComponent(target, options)
decorateComponent(target, options)
decorateComponent(target, options)
forwardRef(fn) Allows to refer to references which are not yet defined.
getComponentMetadata(target) Resolves component metadata from given target
getInjectMetadata(target)
getListenerMetadata(target)
Inject(type, options) A decorator that adds metadata for dependency injection on a class property
Listener(event, options) A decorator that adds metadata for dependency injection on a class property
resolveForwardRef(type) Resolves a type that has been wrapped with forwardRef()

Interfaces

Interface Description
ComponentMetadata
ComponentMetadataOptions Options that can be passed to the Component() decorator
EntityComponent
InjectMetadata A metadata object that is created when using Inject() decorator on a property
InjectOptions Options that can be passed to the Inject() decorator
ListenerMetadata A metadata object that is created when using Inject() decorator on a property
ListenerOptions Options that can be passed to the Listener() decorator
OnAdded A life cycle hook that is called when the component has been added to the entity
OnAttached A life cycle hook that is called when the entity has been added to its parent
OnDestroy A life cycle hook that is called when an entity is being destroyed
OnDetach A life cycle hook that is called when the entity is about to be removed from its parent
OnDraw A life cycle hook that is called once every draw cycle
OnInit A life cycle hook that is called when the component must be initialized
OnRemoved A life cycle hook that is called when the component has been removed from an entity
OnSetup A life cycle hook that is called when a component is installed with options
OnUpdate A life cycle hook that is called once every update cycle

Type Aliases

Type Alias Description
ForwardRefResolvable
InjectMetadataMap An object mapping property names to its inject metadata
ListenerMetadataMap An object mapping event names to its listener metadata
OnSetupOptions