wavelength 1.0.0
Loading...
Searching...
No Matches
Game Class Reference

World of the main game rule set. More...

#include <game.h>

Inheritance diagram for Game:
Collaboration diagram for Game:

Public Member Functions

 Game ()
 Construct a game world.
 ~Game () override
 Turn the software effects off, empty the bank slots, and remove the script commands.
int GetRuleSet () const override
 Report the main game rule set.
bool IsFinished () override
 Report whether the game ended without a player abandoning it.
void Handle (const RotateEvent &event) override
 Record a rotation.
void Handle (const PlayNoteEvent &event) override
 Record a gem button.
void Handle (const BtnEvent< 8 > &event) override
 Ignore a button event of command 8.
void Handle (const StickEvent< 2 > &event) override
 Record a stick event of command 2 while the freestyle track is active.
void Handle (const StickEvent< 6 > &event) override
 Record a stick event of command 6 while the freestyle track is active.
void Handle (const BtnEvent< 3 > &event) override
 Record a button event of command 3.
void Handle (const BtnEvent< 4 > &event) override
 Record a button event of command 4.
void Handle (const BtnEvent< 5 > &event) override
 Record a button event of command 5.
void Handle (const ChangeSectionEvent &event) override
 Ignore a section change.
void Handle (const BtnEvent< 9 > &event) override
 Ignore a button event of command 9.
void Handle (const BtnEvent< 10 > &event) override
 Record a button event of command 10.
void BeginAssetLoad () override
 Load the effect bank and the cheer bank into their synthesiser slots.
void PollAssetLoad () override
 Advance the bank loads.
bool IsAssetLoadDone () override
 Report whether the effect bank is loaded.
void BeginSongLoad () override
 Start the song's track loader.
void PollSongLoad () override
 Advance the song load.
bool IsSongLoadDone () override
 Advance the song's track loader and report whether it finished.
void BeginEnding () override
 Stop the song's track loader and start it again.
void PollEnding () override
 Advance the sequence that follows the end of the game.
bool IsEndingDone () override
 Advance the song's track loader and report whether it finished.
void CreateLogic () override
 Build the logic of the tutorial, the solo game, or the multiplayer game and install it.
void OnStart () override
 Register the script commands of the game.
void BuildTracks (int nStartTick) override
 Build the display of the song's catch tracks.
void ReleaseBanks ()
 Empty the bank slots BeginAssetLoad() filled and forget them.
Public Member Functions inherited from World
 World ()
 Construct a world with no game state.
 ~World () override
 Release the world.
bool DispatchPriv (Message *pMsg) override
 Act on a message sent to the world.
virtual float GetDisplayTime ()
 Report how far the running world has played, from WorldLogic::GetProgress().
virtual void Record (const RotateEvent &event)
 Record a rotation as a serializable input command.
virtual void Record (const PlayNoteEvent &event)
 Record a gem button as a serializable input command.
virtual void Record (const BtnEvent< 8 > &event)
 Record a button event of command 8.
virtual void Record (const StickEvent< 2 > &event)
 Record a stick event of command 2.
virtual void Record (const StickEvent< 6 > &event)
 Record a stick event of command 6.
virtual void Record (const BtnEvent< 3 > &event)
 Record a button event of command 3.
virtual void Record (const BtnEvent< 4 > &event)
 Record a button event of command 4.
virtual void Record (const BtnEvent< 5 > &event)
 Record a button event of command 5.
virtual void Record (const ChangeSectionEvent &event)
 Record a section change.
virtual void Record (const BtnEvent< 9 > &event)
 Record a button event of command 9.
virtual void Record (const BtnEvent< 10 > &event)
 Record a button event of command 10.
void Start ()
 Start the song of a world that finished loading.
void Stop ()
 Stop the song and release what Start() and LoadAssets() created.
int IsRestartRequested ()
 Report whether the world that ended requested a restart.
bool IsFreestyling (int nPlayer)
 Report whether a player is in a freestyle while the song plays.
void Poll ()
 Advance the world by one frame.
bool IsLoaded () const
 Report whether the assets LoadAssets() started are loaded.
void LoadAssets ()
 Start loading the song and the assets of the world.
int GetTick ()
 Report the song position in ticks.
float GetTime ()
 Report the song position on the song clock.
void SetLogic (WorldLogic *pLogic)
 Destroy the installed logic and install another.
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the pool heaps under the tag "MsgSink".
void operator delete (void *pBlock)
 Return a sink to the pool heaps.
virtual ~MsgSink ()
virtual bool Dispatch (Message *pMsg)
 Accept a message.
void * operator new (size_t size)
 Allocate from the main heap under the name MsgSink.
void operator delete (void *mem)
 Return memory to its heap.
virtual ~MsgSink ()
 Destroy the sink.
virtual bool Dispatch (Message *msg)
 Handle a message.

Static Public Member Functions

static void TogglePlayAllGems (DataArray *pCommand, void *pUserData)
 Toggle GameConfig::mPlayAllGems, the play_all_gems script command.
static void TogglePracticeMode (DataArray *pCommand, void *pUserData)
 Toggle the practice mode of GameDb, the practice_mode script command.
static void ToggleNoCapture (DataArray *pCommand, void *pUserData)
 Toggle GameConfig::mNoCapture, the no_capture script command.

Additional Inherited Members

Public Types inherited from World
enum  State {
  kStateIdle = 0 , kStateLoading = 1 , kStateLoaded = 2 , kStatePlaying = 3 ,
  kStateEnding = 4 , kStateRestarting = 5
}
 Values of mState. More...
enum  LoadStep {
  kLoadStepDemo = 0 , kLoadStepSong = 1 , kLoadStepTracks = 2 , kLoadStepMusic = 3 ,
  kLoadStepAssets = 4 , kLoadStepSession = 5 , kLoadStepComplete = 6
}
 Values of mLoadStep. More...
Protected Attributes inherited from World
std::unique_ptr< Song > mSong
DataArray * mSongConfig
int mSeed

Detailed Description

World of the main game rule set.

The RTTI records the class as deriving from World. The object is 0x5c bytes. The world builds a TutorialGameLogic, a SoloGameLogic, or a MultiGameLogic, and while it exists the script commands play_all_gems, practice_mode, and no_capture toggle the matching settings.

Constructor & Destructor Documentation

◆ Game()

Game::Game ( )

Construct a game world.

Ghidra address:
NTSC-U/C: 0x0010d340
Ghidra address:
PAL: 0x0010ea78

◆ ~Game()

Game::~Game ( )
override

Turn the software effects off, empty the bank slots, and remove the script commands.

Ghidra address:
NTSC-U/C: 0x0010d3a0
Ghidra address:
PAL: 0x0010ead8

Member Function Documentation

◆ GetRuleSet()

int Game::GetRuleSet ( ) const
inlineoverridevirtual

Report the main game rule set.

Returns
GameDb::kRuleSetGame.
Ghidra address:
NTSC-U/C: 0x00336208
Ghidra address:
PAL: 0x003a37b8

Implements World.

◆ IsFinished()

bool Game::IsFinished ( )
overridevirtual

Report whether the game ended without a player abandoning it.

Returns
Whether the game ended.
Ghidra address:
NTSC-U/C: 0x0010d5a0
Ghidra address:
PAL: 0x0010ecd8

Implements World.

◆ Handle() [1/11]

void Game::Handle ( const RotateEvent & event)
overridevirtual

Record a rotation.

Parameters
eventThe rotation.
Ghidra address:
NTSC-U/C: 0x0010d610
Ghidra address:
PAL: 0x0010ed48

Implements World.

◆ Handle() [2/11]

void Game::Handle ( const PlayNoteEvent & event)
overridevirtual

Record a gem button.

Parameters
eventThe button.
Ghidra address:
NTSC-U/C: 0x0010d638
Ghidra address:
PAL: 0x0010ed70

Implements World.

◆ Handle() [3/11]

void Game::Handle ( const BtnEvent< 8 > & event)
inlineoverridevirtual

Ignore a button event of command 8.

The body is empty.

Parameters
eventThe button.
Ghidra address:
NTSC-U/C: 0x00336210
Ghidra address:
PAL: 0x003a37c0

Implements World.

◆ Handle() [4/11]

void Game::Handle ( const StickEvent< 2 > & event)
overridevirtual

Record a stick event of command 2 while the freestyle track is active.

Parameters
eventThe stick position.
Ghidra address:
NTSC-U/C: 0x0010d660
Ghidra address:
PAL: 0x0010ed98

Implements World.

◆ Handle() [5/11]

void Game::Handle ( const StickEvent< 6 > & event)
overridevirtual

Record a stick event of command 6 while the freestyle track is active.

Parameters
eventThe stick position.
Ghidra address:
NTSC-U/C: 0x0010d6b0
Ghidra address:
PAL: 0x0010ede8

Implements World.

◆ Handle() [6/11]

void Game::Handle ( const BtnEvent< 3 > & event)
overridevirtual

Record a button event of command 3.

Parameters
eventThe button.
Ghidra address:
NTSC-U/C: 0x0010d700
Ghidra address:
PAL: 0x0010ee38

Implements World.

◆ Handle() [7/11]

void Game::Handle ( const BtnEvent< 4 > & event)
overridevirtual

Record a button event of command 4.

Parameters
eventThe button.
Ghidra address:
NTSC-U/C: 0x0010d728
Ghidra address:
PAL: 0x0010ee60

Implements World.

◆ Handle() [8/11]

void Game::Handle ( const BtnEvent< 5 > & event)
overridevirtual

Record a button event of command 5.

Parameters
eventThe button.
Ghidra address:
NTSC-U/C: 0x0010d750
Ghidra address:
PAL: 0x0010ee88

Implements World.

◆ Handle() [9/11]

void Game::Handle ( const ChangeSectionEvent & event)
inlineoverridevirtual

Ignore a section change.

The body is empty.

Parameters
eventThe section change.
Ghidra address:
NTSC-U/C: 0x00336218
Ghidra address:
PAL: 0x003a37c8

Implements World.

◆ Handle() [10/11]

void Game::Handle ( const BtnEvent< 9 > & event)
inlineoverridevirtual

Ignore a button event of command 9.

The body is empty.

Parameters
eventThe button.
Ghidra address:
NTSC-U/C: 0x00336220
Ghidra address:
PAL: 0x003a37d0

Implements World.

◆ Handle() [11/11]

void Game::Handle ( const BtnEvent< 10 > & event)
overridevirtual

Record a button event of command 10.

Parameters
eventThe button.
Ghidra address:
NTSC-U/C: 0x0010d778
Ghidra address:
PAL: 0x0010eeb0

Implements World.

◆ BeginAssetLoad()

void Game::BeginAssetLoad ( )
overridevirtual

Load the effect bank and the cheer bank into their synthesiser slots.

The "game" section of the configuration supplies the effect bank of the community, the cheer bank, and the effect bank slot. The cheer bank takes the first slot after the song's banks, and the sound memory is divided again to fit it. The PAL build loads the effect bank from SoundFX, or for a language other than English from that language's directory in SoundFX.

Ghidra address:
NTSC-U/C: 0x0010d7a0
Ghidra address:
PAL: 0x0010eed8

Implements World.

◆ PollAssetLoad()

void Game::PollAssetLoad ( )
inlineoverridevirtual

Advance the bank loads.

The body is empty.

Ghidra address:
NTSC-U/C: 0x00336230
Ghidra address:
PAL: 0x003a37e0

Implements World.

◆ IsAssetLoadDone()

bool Game::IsAssetLoadDone ( )
overridevirtual

Report whether the effect bank is loaded.

Returns
Whether the bank is loaded.
Ghidra address:
NTSC-U/C: 0x0010dab0
Ghidra address:
PAL: 0x0010f248

Implements World.

◆ BeginSongLoad()

void Game::BeginSongLoad ( )
overridevirtual

Start the song's track loader.

Ghidra address:
NTSC-U/C: 0x0010dae8
Ghidra address:
PAL: 0x0010f280

Implements World.

◆ PollSongLoad()

void Game::PollSongLoad ( )
inlineoverridevirtual

Advance the song load.

The body is empty.

Ghidra address:
NTSC-U/C: 0x00336228
Ghidra address:
PAL: 0x003a37d8

Implements World.

◆ IsSongLoadDone()

bool Game::IsSongLoadDone ( )
overridevirtual

Advance the song's track loader and report whether it finished.

Returns
Whether the song is loaded.
Ghidra address:
NTSC-U/C: 0x0010db10
Ghidra address:
PAL: 0x0010f2a8

Implements World.

◆ BeginEnding()

void Game::BeginEnding ( )
overridevirtual

Stop the song's track loader and start it again.

Ghidra address:
NTSC-U/C: 0x0010dba8
Ghidra address:
PAL: 0x0010f340

Reimplemented from World.

◆ PollEnding()

void Game::PollEnding ( )
overridevirtual

Advance the sequence that follows the end of the game.

The body is empty.

Ghidra address:
NTSC-U/C: 0x0010dbe0
Ghidra address:
PAL: 0x0010f378

Reimplemented from World.

◆ IsEndingDone()

bool Game::IsEndingDone ( )
overridevirtual

Advance the song's track loader and report whether it finished.

Returns
Whether the loader finished.
Ghidra address:
NTSC-U/C: 0x0010dbe8
Ghidra address:
PAL: 0x0010f380

Reimplemented from World.

◆ CreateLogic()

void Game::CreateLogic ( )
overridevirtual

Build the logic of the tutorial, the solo game, or the multiplayer game and install it.

A demo or the zero_rand_seed setting clears the seed first.

Ghidra address:
NTSC-U/C: 0x0010d4a0
Ghidra address:
PAL: 0x0010ebd8

Implements World.

◆ OnStart()

void Game::OnStart ( )
overridevirtual

Register the script commands of the game.

Ghidra address:
NTSC-U/C: 0x0010d440
Ghidra address:
PAL: 0x0010eb78

Reimplemented from World.

◆ BuildTracks()

void Game::BuildTracks ( int nStartTick)
overridevirtual

Build the display of the song's catch tracks.

Each catch track adds its instrument and its type to the two lists, and a freestyle track sets the option. A solo game outside the tutorial passes the songs of the group the player cleared as the flags, unless the song is of type 1. A demo also shows the demo text.

Parameters
nStartTickThe tick the song starts at.
Ghidra address:
NTSC-U/C: 0x0010dc10
Ghidra address:
PAL: 0x0010f3a8

Implements World.

◆ ReleaseBanks()

void Game::ReleaseBanks ( )

Empty the bank slots BeginAssetLoad() filled and forget them.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0010db38
Ghidra address:
PAL: 0x0010f2d0

◆ TogglePlayAllGems()

void Game::TogglePlayAllGems ( DataArray * pCommand,
void * pUserData )
static

Toggle GameConfig::mPlayAllGems, the play_all_gems script command.

Parameters
pCommandThe command.
pUserDataThe value given to ScriptFunction::Register(), null.
Ghidra address:
NTSC-U/C: 0x0010ef20
Ghidra address:
PAL: 0x001106b8

◆ TogglePracticeMode()

void Game::TogglePracticeMode ( DataArray * pCommand,
void * pUserData )
static

Toggle the practice mode of GameDb, the practice_mode script command.

Parameters
pCommandThe command.
pUserDataThe value given to ScriptFunction::Register(), null.
Ghidra address:
NTSC-U/C: 0x0010ef70
Ghidra address:
PAL: 0x00110708

◆ ToggleNoCapture()

void Game::ToggleNoCapture ( DataArray * pCommand,
void * pUserData )
static

Toggle GameConfig::mNoCapture, the no_capture script command.

Parameters
pCommandThe command.
pUserDataThe value given to ScriptFunction::Register(), null.
Ghidra address:
NTSC-U/C: 0x0010efd0
Ghidra address:
PAL: 0x00110768

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