Add extra component to Entity.component collection. Component must be a subclass of Component. Can only be added to one entity. Max one Components of same type in an Entity.
Create built-in component using: component = runtime.'ComponentTypeName'.create(); Create custom
Component type - inferred from component added.
component to add.
Component Added. null if error.
Gets the item at the given index, allowing for positive and negative integers.
The index (position) of the array element to be returned. Supports relative indexing from the end of the array when passed a negative index; i.e. if a negative number is used, the element returned will be found by counting back from the end of the array.
The element in the array matching the given index. Undefined if outside.
Called when collection being destroyed to release resources on Cogs.js release().
Remove dynamic component from Entity.components
Component to remove. May be predefined in entity or added by user.
Static
create
class ComponentCollection stores added Dynamic components in an Entity.