Entity.register

Register a component C to an entity.

struct Entity
C*
register
(
C
Args...
)
(
Args args
)

Parameters

C

Component to register.

args Args

List of arguments to initialize the component, will be passed to its constructor. Optional.

Return Value

Type: C*

A pointer on the component for this entity.

Throws

EntityException if the entity is invalid. ComponentException if there is no room for that component or if the component is already registered.

Meta