AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Aire::State Struct Referenceabstract

#include <stateMachine.h>

Inheritance diagram for Aire::State:
Inheritance graph
[legend]
Collaboration diagram for Aire::State:
Collaboration graph
[legend]

Public Member Functions

 State (const std::string &name)
 
virtual void onActive ()=0
 
void linkStateAsDst (State *dstState)
 

Public Attributes

std::string name
 
std::unordered_map< std::string, State * > linkedStates
 

Detailed Description

Structure to represent some game state. The state can be connected to a list of destination states. Inherit from this if you require the state to have custom attributes.

Constructor & Destructor Documentation

◆ State()

Aire::State::State ( const std::string & name)
inline

Create a new state with a given name.

Parameters
nameName of the state

Member Function Documentation

◆ linkStateAsDst()

void Aire::State::linkStateAsDst ( State * dstState)
inline

Link another state as a destination state. This means that a transtition from the current state to the destination state becomes possible. The transition can be ordered through a state machine.

Parameters
dstStateThe destination state to attach to the current state.

◆ onActive()

virtual void Aire::State::onActive ( )
pure virtual

Method called when this state becomes the current state in a state machine. Override this to implement specific handling.

Implemented in BoidState.

Here is the caller graph for this function:

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