Hummingbird Framework
 All Classes Functions Variables Modules Pages
hb::FunctionComponent Class Reference

GameObject::Component with parametrized update function.This class allows you to set the functions that must be executed on pre-update, update, post-update and destruction of a GameObject. More...

#include <FunctionComponent.h>

Inheritance diagram for hb::FunctionComponent:
Collaboration diagram for hb::FunctionComponent:

Public Member Functions

 FunctionComponent ()
 Class constructor. More...
 
virtual ~FunctionComponent () override
 Class destructor. More...
 
void addListener (const std::string &name, std::function< void(DataRepository &)> &&listener)
 Add listener to GameObject MessageManager.
 
- Public Member Functions inherited from hb::GameObject::Component
 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.
 
GameObjectgetGameObject () 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

- Protected Member Functions inherited from hb::GameObject::Component
void addListenerToGameObject (const std::string &name, std::function< void(DataRepository &)> &&listener)
 
void ignoreToGameObject (const GameObjectMessageManager::ListenerId< DataRepository > &listener_id)
 

Detailed Description

GameObject::Component with parametrized update function.

This class allows you to set the functions that must be executed on pre-update, update, post-update and destruction of a GameObject.

Constructor & Destructor Documentation

hb::FunctionComponent::FunctionComponent ( )

Class constructor.

All functions are initialized as no-op.

virtual hb::FunctionComponent::~FunctionComponent ( )
overridevirtual

Class destructor.

The function set for destroy is called here.


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