2#include <game/sLib/s_StateInterfaces.hpp>
3#include <game/sLib/s_StateMethod.hpp>
4#include <game/sLib/s_StateID.hpp>
9 mInitFinalizeLock(false),
10 mExecutionLock(false),
13 mRefreshStateMethod(false),
14 mpNewStateID(&initialState),
15 mpOldStateID(&sStateID::null),
16 mpStateID(&initialState),
The interface for state factories.
The interface for state ID checkers.
The interface for state IDs.
virtual bool isNull() const =0
Returns whether this is a null state.
virtual void executeStateLocalMethod()=0
Performs the actual state execution.
virtual int initializeStateLocalMethod()=0
Performs the actual state initialization.
virtual void finalizeStateLocalMethod()=0
Performs the actual state termination.
virtual void initializeStateMethod()
Initializes the current state.
const sStateIDIf_c * mpStateID
The current state ID.
const sStateIDIf_c * mpOldStateID
The previous state ID.
bool mExecutionLock
A lock to ensure executeStateMethod is not called recursively.
sStateMethod_c(sStateIDChkIf_c &checker, sStateFctIf_c &factory, const sStateIDIf_c &initialState)
Constructs a new sStateMethod_c instance.
virtual void finalizeStateMethod()
Prepares the current state for termination.
virtual ~sStateMethod_c()
Destroys the sStateMethod_c instance.
bool mInitFinalizeLock
A lock to ensure initializeStateMethod and finalizeStateMethod are not called recursively.
bool mStateChanged
If the current state has changed during execution.
virtual void changeStateLocalMethod(const sStateIDIf_c &newStateID)=0
Performs the actual state transition.
const sStateIDIf_c * mpNewStateID
The next state ID.
bool mIsValid
If the state holder contains a valid state ID.
virtual void executeStateMethod()
Executes the current state.
virtual void changeStateMethod(const sStateIDIf_c &newStateID)
Transitions to a new state ID.
bool mRefreshStateMethod
True, if after a state transition, the state should be executed again.