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

#include <game/bases/d_cyuukan.hpp>

Description

Checkpoint manager. This is intended to be used as a singleton and kept for the entire game session. It deals with managing the active checkpoint and the collected star coins up until the checkpoint.

  • clearing the data if another level is entered, for example.

Definition at line 12 of file d_cyuukan.hpp.

Public Member Functions

 dCyuukan_c ()
 Creates a new checkpoint manager.
virtual ~dCyuukan_c ()
 Destroys the checkpoint manager.
void clear ()
 Clears the active checkpoint.
void courseIN ()
 Prepares the checkpoint manager when entering a course, clearing the active checkpoint if required.
bool checkEntry ()
 Checks whether all players who have hit any checkpoint are still active.
void setCyuukanData (int checkpointIndex, u8 nextGoto, s8 player, ulong ambushType)
 Sets the checkpoint data after hitting it.
bool isCyuukanStart (int idx, u8 world, u8 course)
 Checks whether the checkpoint is active for a given world and course.
s8 getPlrNo (int idx) const
 Gets the player who hit checkpoint idx .
void setPos (nw4r::math::VEC3 pos)

Public Attributes

int mActiveCheckpointIndex
 The active checkpoint index.
mVec3_c mPlayerSetPos
 Where the player should be set after respawning.
u32 mAmbushType
 The ambush type of the current level.
u8 mWorldNo
 The world in which the active checkpoint is located.
u8 mCourseNo
 The course in which the active checkpoint is located.
u8 mFileNo
 The file in which the active checkpoint is located.
u8 mNextGoto
 The next goto of the active checkpoint.
bool mIsKinopioInChuukan
 Whether Toad was saved before hitting a checkpoint.
PLAYER_TYPE_e mCoinCollection [STAR_COIN_COUNT]
 The collected star coins up until the active checkpoint.
PLAYER_TYPE_e mHitPlayer [CHECKPOINT_COUNT]
 The player who has hit each checkpoint.

Constructor & Destructor Documentation

◆ dCyuukan_c()

dCyuukan_c::dCyuukan_c ( )

Creates a new checkpoint manager.

Definition at line 7 of file d_cyuukan.cpp.

◆ ~dCyuukan_c()

virtual dCyuukan_c::~dCyuukan_c ( )
inlinevirtual

Destroys the checkpoint manager.

Definition at line 15 of file d_cyuukan.hpp.

Member Function Documentation

◆ clear()

void dCyuukan_c::clear ( )

Clears the active checkpoint.

Definition at line 11 of file d_cyuukan.cpp.

◆ courseIN()

void dCyuukan_c::courseIN ( )

Prepares the checkpoint manager when entering a course, clearing the active checkpoint if required.

Definition at line 35 of file d_cyuukan.cpp.

◆ checkEntry()

bool dCyuukan_c::checkEntry ( )

Checks whether all players who have hit any checkpoint are still active.

Definition at line 56 of file d_cyuukan.cpp.

◆ setCyuukanData()

void dCyuukan_c::setCyuukanData ( int checkpointIndex,
u8 nextGoto,
s8 player,
ulong ambushType )

Sets the checkpoint data after hitting it.

Parameters
checkpointIndexThe index of the checkpoint that was hit.
nextGotoThe next goto of the checkpoint.
playerThe player who hit the checkpoint.
ambushTypeThe ambush type of the level.

Definition at line 68 of file d_cyuukan.cpp.

◆ isCyuukanStart()

bool dCyuukan_c::isCyuukanStart ( int idx,
u8 world,
u8 course )

Checks whether the checkpoint is active for a given world and course.

Parameters
idxThe index of the checkpoint.
worldThe world to check.
courseThe course to check.

Definition at line 87 of file d_cyuukan.cpp.

◆ getPlrNo()

s8 dCyuukan_c::getPlrNo ( int idx) const

Gets the player who hit checkpoint idx .

Parameters
idxThe index of the checkpoint.

Definition at line 100 of file d_cyuukan.cpp.

◆ setPos()

void dCyuukan_c::setPos ( nw4r::math::VEC3 pos)
inline

Definition at line 37 of file d_cyuukan.hpp.

Member Data Documentation

◆ mActiveCheckpointIndex

int dCyuukan_c::mActiveCheckpointIndex

The active checkpoint index.

Definition at line 39 of file d_cyuukan.hpp.

◆ mPlayerSetPos

mVec3_c dCyuukan_c::mPlayerSetPos

Where the player should be set after respawning.

Definition at line 40 of file d_cyuukan.hpp.

◆ mAmbushType

u32 dCyuukan_c::mAmbushType

The ambush type of the current level.

Definition at line 41 of file d_cyuukan.hpp.

◆ mWorldNo

u8 dCyuukan_c::mWorldNo

The world in which the active checkpoint is located.

Definition at line 42 of file d_cyuukan.hpp.

◆ mCourseNo

u8 dCyuukan_c::mCourseNo

The course in which the active checkpoint is located.

Definition at line 43 of file d_cyuukan.hpp.

◆ mFileNo

u8 dCyuukan_c::mFileNo

The file in which the active checkpoint is located.

Definition at line 44 of file d_cyuukan.hpp.

◆ mNextGoto

u8 dCyuukan_c::mNextGoto

The next goto of the active checkpoint.

Definition at line 45 of file d_cyuukan.hpp.

◆ mIsKinopioInChuukan

bool dCyuukan_c::mIsKinopioInChuukan

Whether Toad was saved before hitting a checkpoint.

Definition at line 46 of file d_cyuukan.hpp.

◆ mCoinCollection

PLAYER_TYPE_e dCyuukan_c::mCoinCollection[STAR_COIN_COUNT]

The collected star coins up until the active checkpoint.

Definition at line 47 of file d_cyuukan.hpp.

◆ mHitPlayer

PLAYER_TYPE_e dCyuukan_c::mHitPlayer[CHECKPOINT_COUNT]

The player who has hit each checkpoint.

Definition at line 48 of file d_cyuukan.hpp.