NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
s_StateMethodUsr_FI.cpp
1#include <types.h>
2#include <game/sLib/s_StateMethodUsr_FI.hpp>
3
4sStateMethodUsr_FI_c::sStateMethodUsr_FI_c(sStateIDChkIf_c &check, sStateFctIf_c &factory, const sStateIDIf_c &state) :
5 sStateMethod_c(check, factory, state) {
6}
7
9 mpState = mpStateFct.build(*getNewStateID()); // Create new state holder with the next state ID
10 mpState->initialize();
11 return 1;
12}
13
15 initializeStateMethod(); // Ensure we are in a valid state (this only actually initializes the state if !mIsValid)
16 mpState->execute();
17}
18
23
25 finalizeStateMethod(); // Terminate the current state
26 initializeStateMethod(); // Initialize the new state
27}
The interface for state factories.
The interface for state ID checkers.
The interface for state IDs.
virtual void finalizeStateLocalMethod()
Performs the actual state termination.
virtual int initializeStateLocalMethod()
Performs the actual state initialization.
virtual void executeStateLocalMethod()
Performs the actual state execution.
virtual void changeStateLocalMethod(const sStateIDIf_c &newStateID)
Performs the actual state transition.
A class that handles state execution and transition.
virtual void initializeStateMethod()
Initializes the current state.
virtual const sStateIDIf_c * getNewStateID() const
Gets the next state ID.
virtual void finalizeStateMethod()
Prepares the current state for termination.
sStateFctIf_c & mpStateFct
The state factory which produces the state holder.
sStateIf_c * mpState
The current state holder.