Effectively a list of tuples each entry containing an Entity and ComponentReference to each of the component type in the group. These Entity must have the specified components, or else there will be unexpected behaviour. When an Entity no longer has all the required components, it must be removed from the Group.
More...
#include <componentGroup.h>
|
virtual | ~ComponentGroup () |
| Destroy the Component Group object.
|
|
virtual void | addEntity (std::shared_ptr< GameWorld > world, const Entity &entity) override |
| Add an Entity to the Group. This entity must contain all the required components. If such an entity already exists in the group, do nothing.
|
|
virtual void | removeEntity (Entity entity) override |
| Remove an entity from the ComponentGroup.
|
|
std::vector< std::tuple< Entity, ComponentReference< Component >... > >::iterator | begin () |
|
std::vector< std::tuple< Entity, ComponentReference< Component >... > >::iterator | end () |
|
std::vector< std::tuple< Entity, ComponentReference< Component >... > >::const_iterator | begin () const |
|
std::vector< std::tuple< Entity, ComponentReference< Component >... > >::const_iterator | end () const |
|
virtual | ~IComponentGroup ()=default |
| Destroy the IComponentGroup object.
|
|
virtual void | addEntity (std::shared_ptr< GameWorld > world, const Entity &entity)=0 |
| Handle adding an entity to a group. This entity must have all the components specified by the group.
|
|
virtual void | removeEntity (Entity entity)=0 |
| Handle removing an entity from a group.
|
|
template<typename... Component>
class Saga::ComponentGroup< Component >
Effectively a list of tuples each entry containing an Entity and ComponentReference to each of the component type in the group. These Entity must have the specified components, or else there will be unexpected behaviour. When an Entity no longer has all the required components, it must be removed from the Group.
- Template Parameters
-
Component | a list of components all entities in the Group shares. This list must be in alphabetical order. |
◆ ~ComponentGroup()
template<typename... Component>
Destroy the Component Group object.
◆ addEntity()
template<typename... Component>
Add an Entity to the Group. This entity must contain all the required components. If such an entity already exists in the group, do nothing.
- Parameters
-
Implements Saga::IComponentGroup.
◆ begin() [1/2]
template<typename... Component>
◆ begin() [2/2]
template<typename... Component>
◆ end() [1/2]
template<typename... Component>
◆ end() [2/2]
template<typename... Component>
◆ removeEntity()
template<typename... Component>
The documentation for this class was generated from the following files: