|
GPR5100 - Rollback
|
ComponentManager is a class that owns Component in a contiguous array. Component indexing is done with an Entity. More...
#include <component.h>

Public Member Functions | |
| ComponentManager (EntityManager &entityManager) | |
| ComponentManager (const ComponentManager &)=delete | |
| ComponentManager & | operator= (ComponentManager &)=delete |
| ComponentManager (ComponentManager &&)=delete | |
| ComponentManager & | operator= (ComponentManager &&)=delete |
| virtual void | AddComponent (Entity entity) |
| AddComponent is a method that sets the flag C in the EntityManager and resize if need the components_ array. More... | |
| virtual void | RemoveComponent (Entity entity) |
| RemoveComponent is a method that unsets the flag C in the EntityManager. More... | |
| const T & | GetComponent (Entity entity) const |
| GetComponent is a method that gets a constant reference to a Component given the Entity. More... | |
| T & | GetComponent (Entity entity) |
| GetComponent is a method that gets a reference to a Component given the Entity. More... | |
| void | SetComponent (Entity entity, const T &value) |
| SetComponent is a method that sets a new value of the Component of an Entity. More... | |
| const std::vector< T > & | GetAllComponents () const |
| GetAllComponents is a method that returns the internal array of components. More... | |
| void | CopyAllComponents (const std::vector< T > &components) |
| CopyAllComponents is a method that changes the internal components array by copying a newly provided one. It is used by the RollbackManager when reverting the current game world data with the last validated game world data. More... | |
Protected Attributes | |
| EntityManager & | entityManager_ |
| std::vector< T > | components_ |
ComponentManager is a class that owns Component in a contiguous array. Component indexing is done with an Entity.
| T | type of the component |
| C | unique binary flag of the component. This will be set in the EntityMask of the EntityManager when added. |
|
virtual |
AddComponent is a method that sets the flag C in the EntityManager and resize if need the components_ array.
| entity | will have its flag C added in EntityManager |
Reimplemented in core::ScaleManager.

| void core::ComponentManager< T, C >::CopyAllComponents | ( | const std::vector< T > & | components | ) |
CopyAllComponents is a method that changes the internal components array by copying a newly provided one. It is used by the RollbackManager when reverting the current game world data with the last validated game world data.
| components | is the new component array to be copy instead of the old components array |
| const std::vector< T > & core::ComponentManager< T, C >::GetAllComponents |
GetAllComponents is a method that returns the internal array of components.
| T & core::ComponentManager< T, C >::GetComponent | ( | Entity | entity | ) |
GetComponent is a method that gets a reference to a Component given the Entity.
| entity | is the one that we want the Component of. |
| const T & core::ComponentManager< T, C >::GetComponent | ( | Entity | entity | ) | const |
GetComponent is a method that gets a constant reference to a Component given the Entity.
| entity | is the one that we want the Component of. |
|
virtual |
RemoveComponent is a method that unsets the flag C in the EntityManager.
| entity | will have its flag C removed |
| void core::ComponentManager< T, C >::SetComponent | ( | Entity | entity, |
| const T & | value | ||
| ) |
SetComponent is a method that sets a new value of the Component of an Entity.
| entity | will have its component set. |
| value | is the new value that will be set. |