coastline 0.0.4
Loading...
Searching...
No Matches
coastline::RaceSession Class Reference

Race progress and results for one front end. More...

#include <racesession.h>

Public Member Functions

 RaceSession ()=default
 Prepare an inactive session without starting a race or music.
 ~RaceSession ()
 Release the session's race music reference before the race music context is destroyed.
 RaceSession (const RaceSession &)=delete
 Prevent copying race progress and active engine resources.
RaceSession & operator= (const RaceSession &)=delete
 Prevent assignment of race progress and active engine resources.
void Start (const RaceSetup &setup, const std::filesystem::path &music, bool cdAudio)
 Start a race as the front end of the PC release starts one.
RaceEnd Step ()
 Run one frame of the race, a 30th of a second.
void Abandon ()
 End the race that Start() started without running it, and stop its music.
const RaceResults & Results () const
std::array< int, 2 > CameraChoices () const
bool SfxVolumeAdjusted () const

Detailed Description

Race progress and results for one front end.

Constructor & Destructor Documentation

◆ RaceSession() [1/2]

coastline::RaceSession::RaceSession ( )
default

Prepare an inactive session without starting a race or music.

◆ ~RaceSession()

coastline::RaceSession::~RaceSession ( )

Release the session's race music reference before the race music context is destroyed.

◆ RaceSession() [2/2]

coastline::RaceSession::RaceSession ( const RaceSession & )
delete

Prevent copying race progress and active engine resources.

Member Function Documentation

◆ operator=()

RaceSession & coastline::RaceSession::operator= ( const RaceSession & )
delete

Prevent assignment of race progress and active engine resources.

◆ Start()

void coastline::RaceSession::Start ( const RaceSetup & setup,
const std::filesystem::path & music,
bool cdAudio )

Start a race as the front end of the PC release starts one.

The race music starts with it. The working directory is the directory of the default assets, and OpenRaceData() was called.

Parameters
setupThe race.
musicThe directory of the music files.
cdAudioWhether the music is the CD audio of the PC release rather than the modules of the Nintendo 64 release.

◆ Step()

RaceEnd coastline::RaceSession::Step ( )

Run one frame of the race, a 30th of a second.

The race music stops when the race ends.

Returns
How the race ends, or RaceEnd::Running while it goes on.

◆ Abandon()

void coastline::RaceSession::Abandon ( )

End the race that Start() started without running it, and stop its music.

◆ Results()

const RaceResults & coastline::RaceSession::Results ( ) const
Returns
The results of the race that ended last with RaceEnd::Results.

◆ CameraChoices()

std::array< int, 2 > coastline::RaceSession::CameraChoices ( ) const
inline
Returns
Each player's selected camera, or -1 outside player-controlled races.

◆ SfxVolumeAdjusted()

bool coastline::RaceSession::SfxVolumeAdjusted ( ) const
inline
Returns
Whether the pause menu changed SFX volume during the current race, even if restored.

The documentation for this class was generated from the following file: