OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
Fsm Class Reference

#include <Fsm.h>

Inheritance diagram for Fsm:
FsmEventHandler PlatformEventFilter

Public Member Functions

 Fsm (FsmStateEntries states, std::string_view startStateName)
 
void update ()
 Updates the current state of the Fsm and executes any transition. More...
 
bool hasReachedExitState () const
 
- Public Member Functions inherited from FsmEventHandler
 FsmEventHandler ()
 
- Public Member Functions inherited from PlatformEventFilter
 PlatformEventFilter (std::initializer_list< PlatformEventType > eventTypes)
 
 PlatformEventFilter (PlatformEventWildcard eventTypes)
 
virtual bool event (const PlatformEvent *event)
 
const std::vector< PlatformEventTypeeventTypes () const
 

Static Public Attributes

static const std::string_view exitState = "_Exit"
 
static const LogCategory fsmLogCategory
 

Private Member Functions

virtual bool event (const PlatformEvent *event) override
 
void _goToState (std::string_view stateName)
 
void _performAction (FsmAction &action)
 
void _executeTransition (std::string_view transition)
 
FsmStateEntry_getStateByName (std::string_view stateName)
 

Private Attributes

FsmStateEntries _states
 
FsmStateEntry_currentState {}
 
bool _hasReachedExitState {}
 

Additional Inherited Members

- Protected Member Functions inherited from PlatformEventFilter
virtual bool keyPressEvent (const PlatformKeyEvent *event)
 
virtual bool keyReleaseEvent (const PlatformKeyEvent *event)
 
virtual bool mouseMoveEvent (const PlatformMouseEvent *event)
 
virtual bool mousePressEvent (const PlatformMouseEvent *event)
 
virtual bool mouseReleaseEvent (const PlatformMouseEvent *event)
 
virtual bool wheelEvent (const PlatformWheelEvent *event)
 
virtual bool moveEvent (const PlatformMoveEvent *event)
 
virtual bool resizeEvent (const PlatformResizeEvent *event)
 
virtual bool activationEvent (const PlatformWindowEvent *event)
 
virtual bool closeEvent (const PlatformWindowEvent *event)
 
virtual bool gamepadConnectionEvent (const PlatformGamepadEvent *event)
 
virtual bool gamepadKeyPressEvent (const PlatformGamepadKeyEvent *event)
 
virtual bool gamepadKeyReleaseEvent (const PlatformGamepadKeyEvent *event)
 
virtual bool gamepadAxisEvent (const PlatformGamepadAxisEvent *event)
 
virtual bool nativeEvent (const PlatformNativeEvent *event)
 
virtual bool textInputEvent (const PlatformTextInputEvent *event)
 

Constructor & Destructor Documentation

◆ Fsm()

Fsm::Fsm ( FsmStateEntries  states,
std::string_view  startStateName 
)

Member Function Documentation

◆ _executeTransition()

void Fsm::_executeTransition ( std::string_view  transition)
private

◆ _getStateByName()

FsmStateEntry * Fsm::_getStateByName ( std::string_view  stateName)
private

◆ _goToState()

void Fsm::_goToState ( std::string_view  stateName)
private

◆ _performAction()

void Fsm::_performAction ( FsmAction action)
private

◆ event()

bool Fsm::event ( const PlatformEvent event)
overrideprivatevirtual

Reimplemented from PlatformEventFilter.

◆ hasReachedExitState()

bool Fsm::hasReachedExitState ( ) const

◆ update()

void Fsm::update ( )

Updates the current state of the Fsm and executes any transition.

Member Data Documentation

◆ _currentState

FsmStateEntry* Fsm::_currentState {}
private

◆ _hasReachedExitState

bool Fsm::_hasReachedExitState {}
private

◆ _states

FsmStateEntries Fsm::_states
private

◆ exitState

const std::string_view Fsm::exitState = "_Exit"
static

Global string used to specify the state used to exit from the Fsm. When the Fsm jumps to this state, Fsm::hasReachedExitState() will return true.

◆ fsmLogCategory

const LogCategory Fsm::fsmLogCategory
static

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