Atlas
A Convenient Entity Component System
|
Used to represent any game object. More...
#include <Entity.h>
Public Types | |
typedef unsigned int | ID |
ID type for an Entity. More... | |
typedef std::unique_ptr< Entity > | Ptr |
Standard pointer used an Entity. More... | |
Public Member Functions | |
template<typename Type > | |
Type * | getComponent () const |
Retrieves a specified Component from the Entity. More... | |
std::vector< Component * > | getAllComponents () const |
Retrieves all Components that are attached to the Entity. More... | |
void | addComponent (Component::Ptr Component) |
Adds a Component to the Entity. More... | |
template<typename Type > | |
void | removeComponent () |
Removes a specified Component from the Entity. More... | |
ID | getID () const |
Retrieves the ID assigned to the Entity. More... | |
bool | isActive () const |
Checks if the Entity is active. More... | |
void | setActive (bool Flag) |
Sets the active state of the Entity. More... | |
std::bitset< BITSIZE > | getComponentBits () const |
Retrieves the Component bits in use by the Entity. More... | |
void | setSystemBit (const std::bitset< BITSIZE > &Bit) |
Sets a System bit to be assigned to the Entity. More... | |
void | removeSystemBit (const std::bitset< BITSIZE > &Bit) |
Removes a System bit from the Entity. More... | |
std::bitset< BITSIZE > | getSystemBits () const |
Retrieves the System bits assigned to the Entity. More... | |
void | toString () const |
Prints the ID, Component bits, Component list, and Active state of the Entity. More... | |
![]() | |
NonCopyable ()=default | |
Default Constructor. More... | |
virtual | ~NonCopyable () |
Friends | |
class | EntityManager |
Used to represent any game object.
Acts as a grouping/container for Components.
typedef unsigned int Atlas::Entity::ID |
ID type for an Entity.
typedef std::unique_ptr<Entity> Atlas::Entity::Ptr |
Standard pointer used an Entity.
void Atlas::Entity::addComponent | ( | Component::Ptr | Component | ) |
Adds a Component to the Entity.
Usage Example:
Component | - component to be added |
std::vector<Component*> Atlas::Entity::getAllComponents | ( | ) | const |
|
inline |
std::bitset<BITSIZE> Atlas::Entity::getComponentBits | ( | ) | const |
ID Atlas::Entity::getID | ( | ) | const |
std::bitset<BITSIZE> Atlas::Entity::getSystemBits | ( | ) | const |
bool Atlas::Entity::isActive | ( | ) | const |
|
inline |
void Atlas::Entity::removeSystemBit | ( | const std::bitset< BITSIZE > & | Bit | ) |
void Atlas::Entity::setActive | ( | bool | Flag | ) |
Sets the active state of the Entity.
Any inactive Entities will be removed by the EntityManager.
Flag | - status of Entity |
void Atlas::Entity::setSystemBit | ( | const std::bitset< BITSIZE > & | Bit | ) |
void Atlas::Entity::toString | ( | ) | const |
|
friend |