Mixins
Methods
addComponent(component, options)
Add a component to the object.
component |
Component | String | The component to add |
options |
Object |
getComponent(classType, index) → nullable Component
Return the first (or n'th) component of the given type.
classType |
String | Class | Can be a String or Class |
index |
int | Optional index of the component to get. |
getComponents(classType)
Return all components of the object with the given type.
classType |
Array |
getOrAddComponent(componentType, options) → nullable Component
If the object has a component of the given type, return that. Otherwise, a new component of the given type is created and added to the object.
componentType |
String | Class | The type of the component |
options |
Object | Options if the component is created. |
- Component
The existing or new component, null if component wasn't able to be created.
hasComponent(classType) → bool
Does the object have a component of the given type?
classType |
String | Class |
- bool
True if the object has a component.
removeAllComponents()
Remove all components from the object.
removeComponent(componentType) → bool
Remove a component from the object.
componentType |
String | Component | The type of the component to remove. |
- bool
True if a component was removed, false if not.