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

Base class for implementing custom Components. More...

#include <GameObject.h>

Inheritance diagram for hb::GameObject::Component:

Public Member Functions

 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...
 

Protected Member Functions

void addListenerToGameObject (const std::string &name, std::function< void(DataRepository &)> &&listener)
 
void ignoreToGameObject (const GameObjectMessageManager::ListenerId< DataRepository > &listener_id)
 

Friends

class GameObject
 

Detailed Description

Base class for implementing custom Components.

Constructor & Destructor Documentation

hb::GameObject::Component::Component ( )
inline

Default constructor.

At this point getGameObject() is pointing to nothing.

Member Function Documentation

GameObject* hb::GameObject::Component::getGameObject ( ) const
inline

Get the GameObject instance composed by this Component.

Returns
Pointer to GameObject instance composed by the Component, if it has already been added to a GameObject; nullptr otherwise.
virtual void hb::GameObject::Component::init ( )
inlinevirtual

Function called once after the Component has been added to a GameObject.

At this point getGameObject() returns a pointer to the containing GameObject instance.

Reimplemented in hb::RigidBody2dComponent, and hb::ListenerComponent.

bool hb::GameObject::Component::isActive ( ) const
inline

Get if Component is active.

Returns
Is Component active.
void hb::GameObject::Component::setActive ( bool  active)
inline

Set if Component is active.

Parameters
activeIs Component active.

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