Lums
Public Types | Public Member Functions | List of all members
lm::Component Class Referenceabstract

A class that defines behavior and attributes for a GameObject. More...

#include <Component.hpp>

Public Types

using method) = void(Component::*)(
 

Public Member Functions

 Component ()
 
template<typename T >
void bind (int slot, T function) const
 
template<typename T >
void bind (const char *slot, T function) const
 
template<typename... Ts>
void update (Ts...params)
 
template<typename... Ts>
void render (Ts...params)
 
template<typename... Ts>
void handleEvent (Ts...params)
 
void bind (int slot, Component::method function) const
 
Component::method handle (int slot) const
 
bool respondTo (int slot) const
 
virtual ~Component ()=0
 

Detailed Description

A class that defines behavior and attributes for a GameObject.

Member Typedef Documentation

using lm::Component::method = void (Component::*)(

An alias

Constructor & Destructor Documentation

lm::Component::Component ( )

Component ctor

virtual lm::Component::~Component ( )
pure virtual

Pure virtual dtor

Member Function Documentation

template<typename T >
void lm::Component::bind ( int  slot,
function 
) const
inline

Bind a method to a slot

Template Parameters
TUsed for type erasure
Parameters
slotThe destination slot
functionThe method to bind
template<typename T >
void lm::Component::bind ( const char *  slot,
function 
) const
inline

Bind a method to a slot

Template Parameters
TUsed for type erasure
Parameters
slotA string representing a slot - it will be hashed (at compile time if possible)
functionThe method to bind
void lm::Component::bind ( int  slot,
Component::method  function 
) const

Bind a method to a slot

Parameters
slotThe destination slot
functionThe method to bind
Component::method lm::Component::handle ( int  slot) const

Get an untyped handle to a slot

Parameters
slotThe target slot
Returns
An untyped handle to the slot
template<typename... Ts>
void lm::Component::handleEvent ( Ts...  params)
inline

A no-op, catch-all implementation of handleEvent

Template Parameters
TsUsed for type erasure
Parameters
paramsAny parameters
template<typename... Ts>
void lm::Component::render ( Ts...  params)
inline

A no-op, catch-all implementation of render

Template Parameters
TsUsed for type erasure
Parameters
paramsAny parameters
bool lm::Component::respondTo ( int  slot) const

Check if the component react to a slot

Parameters
slotThe slot
Returns
True if the component react, false otherwise
template<typename... Ts>
void lm::Component::update ( Ts...  params)
inline

A no-op, catch-all implementation of update

Template Parameters
TsUsed for type erasure
Parameters
paramsAny parameters

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