Hummingbird Framework
|
A GameObject::Component for storing an instance of T into a GameObject. More...
#include <DataComponent.h>
Public Member Functions | |
DataComponent () | |
Class default constructor. | |
DataComponent (const T &data) | |
Class constructor. More... | |
virtual | ~DataComponent () override |
Class destructor. | |
void | setData (const T &data) |
Data setter. More... | |
T & | getData () |
Data getter. More... | |
const T & | getData () const |
Data getter. More... | |
![]() | |
Component () | |
Default constructor. More... | |
virtual | ~Component () |
Default destructor. | |
virtual void | init () |
Function called once after the Component has been added to a GameObject. More... | |
virtual void | preUpdate () |
Function called in the pre-update step. | |
virtual void | update () |
Function called in the update step. | |
virtual void | postUpdate () |
Function called in the post-update step. | |
GameObject * | getGameObject () const |
Get the GameObject instance composed by this Component. More... | |
void | setActive (bool active) |
Set if Component is active. More... | |
bool | isActive () const |
Get if Component is active. More... | |
Additional Inherited Members | |
![]() | |
void | addListenerToGameObject (const std::string &name, std::function< void(DataRepository &)> &&listener) |
void | ignoreToGameObject (const GameObjectMessageManager::ListenerId< DataRepository > &listener_id) |
A GameObject::Component for storing an instance of T into a GameObject.
|
inline |
Class constructor.
data | T instance to store in the component |
Makes a copy of data and stores it.
|
inline |
Data getter.
|
inline |
Data getter.
|
inline |
Data setter.
data | T instance to store in the component |
Makes a copy of data and stores it.