42 [[nodiscard]]
u16 checkpointId()
const {
43 return m_checkpointId;
46 [[nodiscard]] f32 raceCompletion()
const {
47 return m_raceCompletion;
50 [[nodiscard]] s8 jugemId()
const {
54 [[nodiscard]]
bool drivingWrongWay()
const {
55 return m_drivingWrongWay;
58 [[nodiscard]]
const std::array<Timer, 3> &lapTimers()
const {
62 [[nodiscard]]
const Timer &lapTimer(
size_t idx)
const {
63 ASSERT(idx < m_lapTimers.size());
64 return m_lapTimers[idx];
67 [[nodiscard]]
const Timer &raceTimer()
const {
71 [[nodiscard]]
const KPad *inputs()
const {
79 u16 nextCheckpointId)
const;
83 void endRace(
const Timer &finishTime);
88 f32 m_checkpointStartLapCompletion;
94 bool m_drivingWrongWay;
95 std::array<Timer, 3> m_lapTimers;
111 void endPlayerRace(u32 idx);
116 [[nodiscard]]
bool isStageReached(Stage stage)
const {
117 return static_cast<std::underlying_type_t<Stage>
>(m_stage) >=
118 static_cast<std::underlying_type_t<Stage>
>(stage);
121 [[nodiscard]] MapdataJugemPoint *jugemPoint()
const;
125 [[nodiscard]]
int getCountdownTimer()
const {
126 return STAGE_COUNTDOWN_DURATION - m_timer;
129 [[nodiscard]] Random &random() {
133 [[nodiscard]]
const Player &player()
const {
137 [[nodiscard]]
const TimerManager &timerManager()
const {
138 return m_timerManager;
141 [[nodiscard]] Stage stage()
const {
145 [[nodiscard]] u32 timer()
const {
150 static RaceManager *CreateInstance();
151 static void DestroyInstance();
153 [[nodiscard]]
static RaceManager *Instance() {
159 ~RaceManager()
override;
163 TimerManager m_timerManager;
168 static constexpr u16 STAGE_COUNTDOWN_DURATION = 240;
169 static constexpr u32 RNG_SEED = 0x74A1B095;
171 static RaceManager *s_instance;
Contexts can be used to restore a previous memory state for the current session.