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 * @unofficial
19 *
20 * @param methodList The list of methods in the phase.
21 * @param count The length of the method list.
22 */
23 sPhase_c(phaseMethod **methodList, int count);
24 /**
25 * @brief Executes the phase until the end is reached or a method returns METHOD_RESULT_e::WAIT.
26 *
27 * @param thisPtr A pointer to the owner.
28 * @return METHOD_RESULT_e::WAIT if the phase is not done yet, and METHOD_RESULT_e::DONE if the phase is finished.
29 */
30 METHOD_RESULT_e callMethod(void *thisPtr);
31
32 phaseMethod **mpMethodList; ///< The method list.
33 unsigned short mPhaseLength; ///< The length of the method list.
34 unsigned short mCurrMethod; ///< The index of the method to execute.
35};
phaseMethod ** mpMethodList
The method list.
Definition s_Phase.hpp:32
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:33
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:34
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