NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
sPhase_c Class Reference

#include <game/sLib/s_Phase.hpp>

Description

A phase is a list of methods to be called in order.

Definition at line 5 of file s_Phase.hpp.

Public Types

enum  METHOD_RESULT_e {
  WAIT ,
  OK ,
  DONE
}
 Return value of a phase method and callMethod. More...
 
typedef METHOD_RESULT_e phaseMethod(void *)
 

Public Member Functions

 sPhase_c (phaseMethod **methodList, int count)
 Constructs a new phase with a given method list.
 
METHOD_RESULT_e callMethod (void *thisPtr)
 Executes the phase until the end is reached or a method returns METHOD_RESULT_e::WAIT.
 

Public Attributes

phaseMethod ** mpMethodList
 The method list.
 
unsigned short mPhaseLength
 The length of the method list.
 
unsigned short mCurrMethod
 The index of the method to execute.
 

Member Typedef Documentation

◆ phaseMethod

METHOD_RESULT_e sPhase_c::phaseMethod(void *)

Definition at line 14 of file s_Phase.hpp.

Member Enumeration Documentation

◆ METHOD_RESULT_e

Return value of a phase method and callMethod.

Unofficial name.
Enumerator
WAIT 

Do not proceed to the next method in the phase.

OK 

Proceed to the next method in the phase.

DONE 

The phase is done.

Definition at line 9 of file s_Phase.hpp.

Constructor & Destructor Documentation

◆ sPhase_c()

sPhase_c::sPhase_c ( phaseMethod ** methodList,
int count )

Constructs a new phase with a given method list.

Parameters
methodListThe list of methods in the phase.
countThe length of the method list.

Definition at line 3 of file s_Phase.cpp.

Member Function Documentation

◆ callMethod()

sPhase_c::METHOD_RESULT_e sPhase_c::callMethod ( void * thisPtr)

Executes the phase until the end is reached or a method returns METHOD_RESULT_e::WAIT.

Parameters
thisPtrA pointer to the owner.
Returns
METHOD_RESULT_e::WAIT if the phase is not done yet, and METHOD_RESULT_e::DONE if the phase is finished.

Definition at line 9 of file s_Phase.cpp.

Member Data Documentation

◆ mpMethodList

phaseMethod** sPhase_c::mpMethodList

The method list.

Definition at line 31 of file s_Phase.hpp.

◆ mPhaseLength

unsigned short sPhase_c::mPhaseLength

The length of the method list.

Definition at line 32 of file s_Phase.hpp.

◆ mCurrMethod

unsigned short sPhase_c::mCurrMethod

The index of the method to execute.

Definition at line 33 of file s_Phase.hpp.