Gamedev Framework (gf)  0.11.0
A C++14 framework for 2D games
Public Member Functions | List of all members
gf::ActionContainer Class Reference

A set of actions. More...

#include <gf/Action.h>

Public Member Functions

void addAction (Action &action)
 Add an action. More...
 
bool hasAction (const std::string &name) const
 Check if an action exists. More...
 
ActiongetAction (const std::string &name)
 Get an action thanks to its name. More...
 
const ActiongetAction (const std::string &name) const
 Get an action thanks to its name. More...
 
void processEvent (const Event &event)
 Update all the actions. More...
 
void reset ()
 Reset all the actions. More...
 

Detailed Description

A set of actions.

Member Function Documentation

◆ addAction()

void gf::ActionContainer::addAction ( Action action)

Add an action.

Parameters
actionThe action to add to the set.

◆ getAction() [1/2]

Action& gf::ActionContainer::getAction ( const std::string &  name)

Get an action thanks to its name.

Parameters
nameThe name of the action
Returns
The action with that name
Exceptions
std::runtime_errorIf the action is not found

◆ getAction() [2/2]

const Action& gf::ActionContainer::getAction ( const std::string &  name) const

Get an action thanks to its name.

Parameters
nameThe name of the action
Returns
The action with that name
Exceptions
std::runtime_errorIf the action is not found

◆ hasAction()

bool gf::ActionContainer::hasAction ( const std::string &  name) const

Check if an action exists.

Parameters
nameThe name of the action
Returns
True if there is an action with that name

◆ processEvent()

void gf::ActionContainer::processEvent ( const Event event)

Update all the actions.

Parameters
eventthe event to update the actions.
See also
Action;:processEvent()

◆ reset()

void gf::ActionContainer::reset ( )

Reset all the actions.

See also
Action::reset()