This repository was archived by the owner on Jul 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Entity
Allan Deutsch edited this page Apr 1, 2018
·
1 revision
| Function | Description | Parameters |
|---|---|---|
Entity(World &, EntityID) |
Construct and Entity. |
|
Entity(Entity &&) |
Move an Entity in memory. |
Entity && The Entity being moved to this location. |
Entity& operator=(Entity &&) |
Assign an Entity to a new memory location. |
Entity && The Entity being moved to this location. |
| Function | Description | Returns | Parameters |
|---|---|---|---|
| EntityID ID() const | Get the ID of this Entity. | This Entity's ID. | N/A |
| const std::string &Name() const | Get the name of this Entity. | This Entity's name. | N/A |
Entity& Name(const std::string &) |
Set the name of this Entity. | A reference to this Entity. |
const std::string & - The new name of this Entity. |
| Function | Description | Returns | Parameters |
|---|---|---|---|
bool Has<T>() const |
Check if this Entity has a component of type T. |
true if this Entity has a component of type T, false otherwise. |
T - The type of component to check for. |
bool Has<Components...>() const |
Check if this Entity has components of multiple types. | 'true' if this Entity has components of each type in the Components... parameter pack, false otherwise. |
Components... - The types of components to check for. |
Component& Get<Component>() |
Get mutable access to a component. | A reference to the component of type Component. |
Component - the type of Component to get. |
const Component& Get<Component>() |
Get immutable access to a component. | A const reference to the component of type Component. |
Component - the const-qualified type of Component to get. |
| Function | Description | Returns | Parameters |
|---|---|---|---|
Component& Add<Component, Args...>(Args&&...) |
Add a component of type Component. |
A reference to the component of type Component attached to this Entity. |
|
void Remove<Component>() |
Remove the component of type Component from this Entity. |
N/A |
Component - the type of component to remove. |
| Function | Description | Returns | Parameters |
|---|---|---|---|
| EntityRef Clone() const | Make a copy of this Entity. | An EntityRef referencing the newly created clone. | N/A |