2#include <game/sLib/s_StateID.hpp>
3#include <lib/MSL_C/string.h>
12 typedef void (T::*stateFunc)();
22 sFStateID_c(
const char *
name, stateFunc initialize, stateFunc execute, stateFunc finalize) :
30 char *part = strrchr(otherName,
':');
31 if (part !=
nullptr) {
34 const char *thisName = strrchr(
name(),
':') + 1;
35 if (strcmp(thisName, otherName) == 0) {
An implementation of a state ID for a given class.
stateFunc mpFinalize
The finalize method for this state ID.
virtual void finalizeState(T &owner) const
Calls the finalize method on the owner.
stateFunc mpInitialize
The initialize method for this state ID.
virtual void executeState(T &owner) const
Calls the execute method on the owner.
virtual void initializeState(T &owner) const
Calls the initialize method on the owner.
stateFunc mpExecute
The execute method for this state ID.
virtual bool isSameName(const char *otherName) const
Returns true if the given name matches this state ID's name.
sFStateID_c(const char *name, stateFunc initialize, stateFunc execute, stateFunc finalize)
Constructs a new sFStateID_c instance.
A generic implementation of a state ID.
virtual const char * name() const
Returns the name of this state ID.