Base system class with components. More...
#include <ecsm.hpp>
Public Member Functions | |
const std::string & | getComponentName () const override |
Returns specific component name of the system. | |
std::type_index | getComponentType () const override |
Returns specific component typeid() of the system. | |
View< Component > | getComponent (ID< Component > instance) override |
Returns specific component View. | |
void | disposeComponents () override |
Actually destroys system components. | |
bool | hasComponent (ID< Entity > entity) const |
Returns true if entity has specific component. | |
View< T > | getComponent (ID< Entity > entity) const |
Returns entity specific component view. | |
View< T > | tryGetComponent (ID< Entity > entity) const |
Returns entity specific component view if exist. | |
Protected Member Functions | |
ID< Component > | createComponent (ID< Entity > entity) override |
Creates a new component instance for the entity. | |
void | destroyComponent (ID< Component > instance) override |
Destroys component instance. | |
void | copyComponent (View< Component > source, View< Component > destination) override |
Copies component data from source to destination. | |
Protected Attributes | |
LinearPool< T, DestroyComponents > | components |
System component pool. | |
Base system class with components.
See the System.
T | type of the system component |
DestroyComponents | system should call destroy() function of the components |
|
inlineoverridevirtual |
Returns specific component name of the system.
Reimplemented from System.
Reimplemented in DoNotDestroySystem, and DoNotDuplicateSystem.
|
inlineoverridevirtual |
Returns specific component typeid() of the system.
Reimplemented from System.
|
inlineoverridevirtual |
Actually destroys system components.
Components are not destroyed immediately, only after the dispose call.
Reimplemented from System.
|
inline |
Returns true if entity has specific component.
entity | target entity with component |
|
inline |
Returns entity specific component view.
entity | target entity with component |