NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
s_Phase.hpp
1#pragma once
2
3/// @brief A phase is a list of methods to be called in order.
4/// @ingroup slib
5class sPhase_c {
6public:
7 /// @brief Return value of a phase method and ::callMethod.
8 /// @unofficial
10 WAIT, ///< Do not proceed to the next method in the phase.
11 OK, ///< Proceed to the next method in the phase.
12 DONE ///< The phase is done.
13 };
14 typedef METHOD_RESULT_e (phaseMethod)(void *);
15
16 /**
17 * @brief Constructs a new phase with a given method list.
18 *
19 * @param methodList The list of methods in the phase.
20 * @param count The length of the method list.
21 */
22 sPhase_c(phaseMethod **methodList, int count);
23 /**
24 * @brief Executes the phase until the end is reached or a method returns METHOD_RESULT_e::WAIT.
25 *
26 * @param thisPtr A pointer to the owner.
27 * @return METHOD_RESULT_e::WAIT if the phase is not done yet, and METHOD_RESULT_e::DONE if the phase is finished.
28 */
29 METHOD_RESULT_e callMethod(void *thisPtr);
30
31 phaseMethod **mpMethodList; ///< The method list.
32 unsigned short mPhaseLength; ///< The length of the method list.
33 unsigned short mCurrMethod; ///< The index of the method to execute.
34};
phaseMethod ** mpMethodList
The method list.
Definition s_Phase.hpp:31
METHOD_RESULT_e
Return value of a phase method and callMethod.
Definition s_Phase.hpp:9
@ OK
Proceed to the next method in the phase.
Definition s_Phase.hpp:11
@ WAIT
Do not proceed to the next method in the phase.
Definition s_Phase.hpp:10
@ DONE
The phase is done.
Definition s_Phase.hpp:12
unsigned short mPhaseLength
The length of the method list.
Definition s_Phase.hpp:32
sPhase_c(phaseMethod **methodList, int count)
Constructs a new phase with a given method list.
Definition s_Phase.cpp:3
unsigned short mCurrMethod
The index of the method to execute.
Definition s_Phase.hpp:33
METHOD_RESULT_e callMethod(void *thisPtr)
Executes the phase until the end is reached or a method returns METHOD_RESULT_e::WAIT.
Definition s_Phase.cpp:9