Atlas
A Convenient Entity Component System
 All Classes Namespaces Files Functions Variables Typedefs Friends
Atlas::GroupManager Class Reference

Used to organize entities into named groups. More...

#include <GroupManager.h>

Inheritance diagram for Atlas::GroupManager:
Collaboration diagram for Atlas::GroupManager:

Public Member Functions

 GroupManager ()
 Default Constructor. More...
 
void addToGroup (const std::string &name, const Entity &entity)
 Adds an Entity to a group. More...
 
void removeFromAllGroups (const Entity &entity)
 Removes an Entity from all groups that it is in. More...
 
void removeFromGroup (const std::string &name, const Entity &entity, bool fullErase=false)
 Removes an Entity from a specific group. More...
 
std::vector< Entity::IDgetGroup (const std::string &name)
 Retrieves all Entities from a group. More...
 
std::vector< std::string > getEntityGroups (const Entity &entity) const
 Retrieves all groups that an Entity is in. More...
 
void toString ()
 Prints each group with the ID's of the Entities that are included. More...
 
- Public Member Functions inherited from Atlas::NonCopyable
 NonCopyable ()=default
 Default Constructor. More...
 
virtual ~NonCopyable ()
 

Detailed Description

Used to organize entities into named groups.

Constructor & Destructor Documentation

Atlas::GroupManager::GroupManager ( )

Default Constructor.

Member Function Documentation

void Atlas::GroupManager::addToGroup ( const std::string &  name,
const Entity entity 
)

Adds an Entity to a group.

Parameters
name- the name of the group
entity- the Entity to be added
std::vector<std::string> Atlas::GroupManager::getEntityGroups ( const Entity entity) const

Retrieves all groups that an Entity is in.

Parameters
entity- the Entity of interest.
Returns
container of named groups that the Entity is in.
std::vector<Entity::ID> Atlas::GroupManager::getGroup ( const std::string &  name)

Retrieves all Entities from a group.

Parameters
name- the name of the group
Returns
container of Entity::IDs that are in the group
void Atlas::GroupManager::removeFromAllGroups ( const Entity entity)

Removes an Entity from all groups that it is in.

Parameters
entity- the Entity to be removed
void Atlas::GroupManager::removeFromGroup ( const std::string &  name,
const Entity entity,
bool  fullErase = false 
)

Removes an Entity from a specific group.

Parameters
name- the name of the group
entity- the Entity to be removed
fullErase- only true if Entity is being removed from all groups
void Atlas::GroupManager::toString ( )

Prints each group with the ID's of the Entities that are included.


The documentation for this class was generated from the following file: