Main class for any object in game, stores associations, labeling and components.
More...
#include <Entity.h>
Main class for any object in game, stores associations, labeling and components.
The entity class is the primary class each object in the game needs to use. Add components to assign functionality.
- Todo
More detailed description
Some functions in entity class are only supposed to be called in specific context, which might be valid uses for friend keyword. Example: Entity() should only be called from Manager::addEntity(). Verify each functions intended use/scope.
◆ GroupLabel
Used for rendering order (last is highest) or retrieving entities of group.
- Todo
Label used in singular entity shouldn't use plural
HEARTS are rendered above POWERUPS, missleading order
PROJECTILE are rendered above POWERUPS, missleading order
Generalize HEARTS as UI or similar
◆ Entity()
| Entity::Entity |
( |
Manager & | mManager | ) |
|
|
inlineexplicit |
◆ addComponent()
template<typename T , typename... TArgs>
| T & Entity::addComponent |
( |
TArgs &&... | mArgs | ) |
|
|
inline |
Adds specified type as component and calls Component::init()
- Parameters
-
| mArgs | Constructor arguments of component |
◆ addGroup()
| void Entity::addGroup |
( |
Group | mGroup | ) |
|
◆ delGroup()
| void Entity::delGroup |
( |
Group | mGroup | ) |
|
◆ destroy()
◆ getComponent()
template<typename T >
| T & Entity::getComponent |
( |
| ) |
const |
|
inline |
◆ getGroupBitSet()
| std::bitset< MAX_GROUPS > Entity::getGroupBitSet |
( |
| ) |
|
- Returns
- bitset with true on position GroupLabel if the entity belongs to group
- See also
- GroupLabel
◆ getManager()
◆ hasComponent()
template<typename T >
| bool Entity::hasComponent |
( |
| ) |
const |
|
inline |
◆ hasGroup()
| bool Entity::hasGroup |
( |
Group | mGroup | ) |
|
◆ isActive()
| bool Entity::isActive |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: