new Entity(manager, uid)
Containers of components
Parameters:
Name | Type | Description |
---|---|---|
manager |
ComponentManager | The component manager related to the entity |
uid |
number | uid of the entity |
Members
-
<static> componentsSet :number
-
Components Ids of the entity
Type:
- number
-
<static> manager :ComponentManager
-
Component manager of the entity
Type:
-
<static> uid :number
-
uid of the entity
Type:
- number
Methods
-
addComponent(name)
-
Add a component to the entity
Parameters:
Name Type Description name
string Name of The Component
-
getAllComponents()
-
Get all components of the entity
Returns:
Array of entity's components
- Type
- Array.<Component>
-
getComponentsSet()
-
Get the Components Set of the entity
Returns:
Set of components' id
- Type
- Array
-
getUID()
-
Get the id of Entity
Returns:
uid
- Type
- number
-
hasComponent(name)
-
Get the component of the entity with the name in parameter
Parameters:
Name Type Description name
string Name of Component
Returns:
Boolean if the entity exists
- Type
- boolean
-
removeAllComponents()
-
Remove all components of the entity
-
removeComponent(name)
-
Remove a component to the entity
Parameters:
Name Type Description name
string Name of the component