A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
System::RaceManager Class Reference0x809BD730

#include <RaceManager.hh>

Description

Manages the timers that track the stages of a race. Also acts as the interface between the physics engine and CourseMap.

The physics engine leverages the RaceManager in order to determine what stage of the race we're in, as that affects several things like acceleration. This class also retrieves the player start position from CourseMap and communicates it to the physics engine.

Definition at line 18 of file RaceManager.hh.

Inheritance diagram for System::RaceManager:

Classes

class  Player
 

Public Types

enum class  Stage {
  Intro = 0 ,
  Countdown = 1 ,
  Race = 2 ,
  FinishLocal = 3 ,
  FinishGlobal = 4
}
 

Public Member Functions

void init ()
 
void findKartStartPoint (EGG::Vector3f &pos, EGG::Vector3f &angles)
 
void endPlayerRace (u32 idx)
 
void calc ()
 
bool isStageReached (Stage stage) const
 
MapdataJugemPointjugemPoint () const
 

Static Public Member Functions

static RaceManagerCreateInstance ()
 
static void DestroyInstance ()
 
static RaceManagerInstance ()
 

Getters

int getCountdownTimer () const
 
const Playerplayer () const
 
const TimerManagertimerManager () const
 
Stage stage () const
 
u32 timer () const
 

Private Attributes

Player m_player
 
TimerManager m_timerManager
 
Stage m_stage
 
u16 m_introTimer
 
u32 m_timer
 

Static Private Attributes

static constexpr u16 STAGE_COUNTDOWN_DURATION = 240
 
static RaceManagers_instance = nullptr
 

Additional Inherited Members

- Private Member Functions inherited from EGG::Disposer
- Static Private Member Functions inherited from EGG::Disposer
static constexpr u16 getLinkOffset ()
 

Member Enumeration Documentation

◆ Stage

enum class System::RaceManager::Stage
strong

Definition at line 84 of file RaceManager.hh.

Constructor & Destructor Documentation

◆ RaceManager()

System::RaceManager::RaceManager ( )
private0x805327A0

Definition at line 91 of file RaceManager.cc.

Member Function Documentation

◆ ~RaceManager()

System::RaceManager::~RaceManager ( )
overrideprivate0x80532E3C

Definition at line 94 of file RaceManager.cc.

◆ calc()

void System::RaceManager::calc ( )
0x805331B4

Definition at line 42 of file RaceManager.cc.

◆ CreateInstance()

RaceManager * System::RaceManager::CreateInstance ( )
static0x80532084

Definition at line 76 of file RaceManager.cc.

◆ DestroyInstance()

void System::RaceManager::DestroyInstance ( )
static0x805320D4

Definition at line 83 of file RaceManager.cc.

◆ endPlayerRace()

void System::RaceManager::endPlayerRace ( u32 idx)
0x80533C6C

Definition at line 36 of file RaceManager.cc.

◆ findKartStartPoint()

void System::RaceManager::findKartStartPoint ( EGG::Vector3f & pos,
EGG::Vector3f & angles )
0x805362DC
Todo
When expanding to other gamemodes, we will need to pass the player index

Definition at line 20 of file RaceManager.cc.

◆ getCountdownTimer()

int System::RaceManager::getCountdownTimer ( ) const
inlinenodiscard

Definition at line 109 of file RaceManager.hh.

◆ init()

void System::RaceManager::init ( )
0x80532F88

Definition at line 14 of file RaceManager.cc.

◆ Instance()

static RaceManager * System::RaceManager::Instance ( )
inlinestaticnodiscard

Definition at line 133 of file RaceManager.hh.

◆ isStageReached()

bool System::RaceManager::isStageReached ( Stage stage) const
inlinenodiscard0x80536230

Definition at line 100 of file RaceManager.hh.

◆ jugemPoint()

MapdataJugemPoint * System::RaceManager::jugemPoint ( ) const
nodiscard0x8053621C

Definition at line 70 of file RaceManager.cc.

◆ player()

const Player & System::RaceManager::player ( ) const
inlinenodiscard

Definition at line 113 of file RaceManager.hh.

◆ stage()

Stage System::RaceManager::stage ( ) const
inlinenodiscard

Definition at line 121 of file RaceManager.hh.

◆ timer()

u32 System::RaceManager::timer ( ) const
inlinenodiscard

Definition at line 125 of file RaceManager.hh.

◆ timerManager()

const TimerManager & System::RaceManager::timerManager ( ) const
inlinenodiscard

Definition at line 117 of file RaceManager.hh.

Member Data Documentation

◆ m_introTimer

u16 System::RaceManager::m_introTimer
private

Definition at line 144 of file RaceManager.hh.

◆ m_player

Player System::RaceManager::m_player
private

Definition at line 141 of file RaceManager.hh.

◆ m_stage

Stage System::RaceManager::m_stage
private

Definition at line 143 of file RaceManager.hh.

◆ m_timer

u32 System::RaceManager::m_timer
private

Definition at line 145 of file RaceManager.hh.

◆ m_timerManager

TimerManager System::RaceManager::m_timerManager
private

Definition at line 142 of file RaceManager.hh.

◆ s_instance

RaceManager * System::RaceManager::s_instance = nullptr
staticprivate0x809BD730

Definition at line 149 of file RaceManager.hh.

◆ STAGE_COUNTDOWN_DURATION

u16 System::RaceManager::STAGE_COUNTDOWN_DURATION = 240
staticconstexprprivate

Definition at line 147 of file RaceManager.hh.