NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_cyuukan.hpp
1#pragma once
2
3#include <game/bases/d_s_stage.hpp>
4#include <game/mLib/m_vec.hpp>
6
7/// @brief Checkpoint manager.
8/// This is intended to be used as a singleton and kept for the entire game session.
9/// It deals with managing the active checkpoint and the collected star coins up until the checkpoint
10/// - clearing the data if another level is entered, for example.
11/// @ingroup bases
13public:
14 dCyuukan_c(); ///< Creates a new checkpoint manager.
15 virtual ~dCyuukan_c() {} ///< Destroys the checkpoint manager.
16 void clear(); ///< Clears the active checkpoint.
17 void courseIN(); ///< Prepares the checkpoint manager when entering a course, clearing the active checkpoint if required.
18 bool checkEntry(); ///< Checks whether all players who have hit any checkpoint are still active.
19
20 /// @brief Sets the checkpoint data after hitting it.
21 /// @param checkpointIndex The index of the checkpoint that was hit.
22 /// @param nextGoto The next goto of the checkpoint.
23 /// @param player The player who hit the checkpoint.
24 /// @param ambushType The ambush type of the level.
25 void setCyuukanData(int checkpointIndex, u8 nextGoto, s8 player, ulong ambushType);
26
27 /// @brief Checks whether the checkpoint is active for a given world and course.
28 /// @param idx The index of the checkpoint.
29 /// @param world The world to check.
30 /// @param course The course to check.
31 bool isCyuukanStart(int idx, u8 world, u8 course);
32
33 /// @brief Gets the player who hit checkpoint @p idx .
34 /// @param idx The index of the checkpoint.
35 s8 getPlrNo(int idx) const;
36
37 void setPos(nw4r::math::VEC3 pos) { mPlayerSetPos = pos; }
38
39 int mActiveCheckpointIndex; ///< The active checkpoint index.
40 mVec3_c mPlayerSetPos; ///< Where the player should be set after respawning.
41 u32 mAmbushType; ///< The ambush type of the current level.
42 u8 mWorldNo; ///< The world in which the active checkpoint is located.
43 u8 mCourseNo; ///< The course in which the active checkpoint is located.
44 u8 mFileNo; ///< The file in which the active checkpoint is located.
45 u8 mNextGoto; ///< The next goto of the active checkpoint.
46 bool mIsKinopioInChuukan; ///< Whether Toad was saved before hitting a checkpoint.
47 PLAYER_TYPE_e mCoinCollection[STAR_COIN_COUNT]; ///< The collected star coins up until the active checkpoint.
48 PLAYER_TYPE_e mHitPlayer[CHECKPOINT_COUNT]; ///< The player who has hit each checkpoint.
49};
PLAYER_TYPE_e mCoinCollection[STAR_COIN_COUNT]
The collected star coins up until the active checkpoint.
Definition d_cyuukan.hpp:47
PLAYER_TYPE_e mHitPlayer[CHECKPOINT_COUNT]
The player who has hit each checkpoint.
Definition d_cyuukan.hpp:48
bool mIsKinopioInChuukan
Whether Toad was saved before hitting a checkpoint.
Definition d_cyuukan.hpp:46
void courseIN()
Prepares the checkpoint manager when entering a course, clearing the active checkpoint if required.
Definition d_cyuukan.cpp:35
bool isCyuukanStart(int idx, u8 world, u8 course)
Checks whether the checkpoint is active for a given world and course.
Definition d_cyuukan.cpp:87
void setCyuukanData(int checkpointIndex, u8 nextGoto, s8 player, ulong ambushType)
Sets the checkpoint data after hitting it.
Definition d_cyuukan.cpp:68
virtual ~dCyuukan_c()
Destroys the checkpoint manager.
Definition d_cyuukan.hpp:15
s8 getPlrNo(int idx) const
Gets the player who hit checkpoint idx .
mVec3_c mPlayerSetPos
Where the player should be set after respawning.
Definition d_cyuukan.hpp:40
dCyuukan_c()
Creates a new checkpoint manager.
Definition d_cyuukan.cpp:7
u8 mWorldNo
The world in which the active checkpoint is located.
Definition d_cyuukan.hpp:42
u8 mNextGoto
The next goto of the active checkpoint.
Definition d_cyuukan.hpp:45
void clear()
Clears the active checkpoint.
Definition d_cyuukan.cpp:11
u8 mCourseNo
The course in which the active checkpoint is located.
Definition d_cyuukan.hpp:43
bool checkEntry()
Checks whether all players who have hit any checkpoint are still active.
Definition d_cyuukan.cpp:56
u32 mAmbushType
The ambush type of the current level.
Definition d_cyuukan.hpp:41
int mActiveCheckpointIndex
The active checkpoint index.
Definition d_cyuukan.hpp:39
u8 mFileNo
The file in which the active checkpoint is located.
Definition d_cyuukan.hpp:44
A three-dimensional floating point vector.
Definition m_vec.hpp:107
PLAYER_TYPE_e
The identifiers for each player type.
#define STAR_COIN_COUNT
The amount of Star Coins per level.
#define CHECKPOINT_COUNT
The maximum number of checkpoints supported.