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

Attract-demo rotation for one front end. More...

#include <racedemo.h>

Public Member Functions

 AttractDemo ()
 Register the exclusive attract-demo controller with the first recording selected next.
 ~AttractDemo ()
 Unregister the controller after its active race has shut down.
 AttractDemo (const AttractDemo &)=delete
 Prevent copying the registered demo controller.
AttractDemo & operator= (const AttractDemo &)=delete
 Prevent assignment of the registered demo controller.
ConsoleCredits & Credits ()
const ConsoleCredits & Credits () const
const char * NextRecording ()
void Start ()
 Start the attract demo as the root menu of the PC release starts it, on the recording after the one it played last.
void StartCredits (bool scrolling)
 Start the race of the credits, on the recording of the credits of the PC release, as StartCreditsRace() of the console starts the captions from the options menu and StartEndingCredits() starts the scrolling credits after the last season.
bool Step (bool leave)
 Run one frame of the race of the demo, a 30th of a second.
bool Interrupted () const
int Track () const
int Car () const
std::array< std::uint8_t, 3 > Color () const
bool FromConsole () const

Static Public Member Functions

static AttractDemo * Active ()

Detailed Description

Attract-demo rotation for one front end.

One instance exists at a time.

Constructor & Destructor Documentation

◆ AttractDemo() [1/2]

coastline::AttractDemo::AttractDemo ( )

Register the exclusive attract-demo controller with the first recording selected next.

◆ ~AttractDemo()

coastline::AttractDemo::~AttractDemo ( )

Unregister the controller after its active race has shut down.

◆ AttractDemo() [2/2]

coastline::AttractDemo::AttractDemo ( const AttractDemo & )
delete

Prevent copying the registered demo controller.

Member Function Documentation

◆ operator=()

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

Prevent assignment of the registered demo controller.

◆ Active()

AttractDemo * coastline::AttractDemo::Active ( )
static
Returns
The active demo controller, or null outside its lifetime.

◆ Credits() [1/2]

ConsoleCredits & coastline::AttractDemo::Credits ( )
inline
Returns
Credits displayed over the demo controller's race.

◆ Credits() [2/2]

const ConsoleCredits & coastline::AttractDemo::Credits ( ) const
inline
Returns
Credits displayed over the demo controller's race.

◆ NextRecording()

const char * coastline::AttractDemo::NextRecording ( )
Returns
The next recording path, valid until the next selection or destruction.

◆ Start()

void coastline::AttractDemo::Start ( )

Start the attract demo as the root menu of the PC release starts it, on the recording after the one it played last.

The working directory is the directory of the default assets.

◆ StartCredits()

void coastline::AttractDemo::StartCredits ( bool scrolling)

Start the race of the credits, on the recording of the credits of the PC release, as StartCreditsRace() of the console starts the captions from the options menu and StartEndingCredits() starts the scrolling credits after the last season.

The console scrolls the credits of the options menu instead under the multiplayer mode of a cheat, absent from the SDL game. Step() runs the race. The working directory is the directory of the default assets.

Parameters
scrollingWhether the credits scroll rather than show as captions.

◆ Step()

bool coastline::AttractDemo::Step ( bool leave)

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

Parameters
leaveWhether a button that leaves the demo was pressed, as the pause binding of the PC release leaves it.
Returns
Whether the demo continues, or false after its time expires or a button ends the demo.

◆ Interrupted()

bool coastline::AttractDemo::Interrupted ( ) const
Returns
Whether a button ended the last demo before its time expired.

◆ Track()

int coastline::AttractDemo::Track ( ) const
Returns
The track of the demo, an index of g_apszTrackFilenames, once its race has loaded.

◆ Car()

int coastline::AttractDemo::Car ( ) const
Returns
The car of the demo, an index of g_apszCarModelPrefixes, once its race has loaded.

◆ Color()

std::array< std::uint8_t, 3 > coastline::AttractDemo::Color ( ) const
Returns
The red, green, and blue of the colour of the car of the demo, once its race has loaded.

◆ FromConsole()

bool coastline::AttractDemo::FromConsole ( ) const
Returns
Whether the demo is the one of a cartridge, recorded at its import. The console plays it in fog with no help on the screen and ends it with its recording.

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