resonance 1.0.1
Loading...
Searching...
No Matches
GameStats Class Reference

Running tally a game session accumulates. More...

#include <gamestats.h>

Public Member Functions

 GameStats ()
 Start with every counter clear and all three vectors empty.
virtual ~GameStats ()
 Release the three vectors.
void Reset (int nPlayers)
 Clear the tally for a new game and give each player a zero entry in every vector.
int GetScore (int nPlayer)
void SetScore (int nPlayer, int nScore)
float GetProgress ()
void SetProgress (float flProgress)
float GetRatio (int nPlayer)
void SetRatio (int nPlayer, float flRatio)
int GetTally (int nPlayer)
void SetTally (int nPlayer, int nTally)

Public Attributes

int mPlayerCount
 The number of players the session records.
int mCompleted
 Non-zero when the solo song was completed.
int mCheated
 Non-zero when a cheat ran during the solo game, copied from Gamer::mCheated.
int mRemixEdited
 Non-zero once the jam's phrases or remix effects changed.

Friends

class GrooveWorld

Detailed Description

Running tally a game session accumulates.

Its RTTI descriptor is at 0x0086f620. It has no base. The compiler places the vptr after the data at +0x3c, and the class is 0x40 bytes. Its vtable is at 0x007cd738 and has two entries, the compiler-generated type function and the destructor. The destructor is the only virtual the class declares.

The size, the vptr offset, and the three vectors all fall out of the constructor at 0x0010f150 and the destructor at 0x0010b648 together. The destructor releases the three vectors in reverse declaration order and frees the object under the tag GameStats, which is what confirms the class name against the descriptor independently.

GameManagerImpl embeds one at +0x28 and vends its address through vtable slot 19. The GrooveWorld constructor receives that address and stores it, so the world writes the tally while the manager owns it.

Reset() sizes the three per-player vectors, and Gamer fills them when a game ends. The metagame statistics screens read them back through the accessors, printing a score and a tally with d and a progress and a ratio, each scaled by 100, with %3d%%. GrooveWorld writes mRemixEdited directly, which a friend declaration models; a public member fits the image equally well.

Constructor & Destructor Documentation

◆ GameStats()

GameStats::GameStats ( )

Start with every counter clear and all three vectors empty.

The constructor does not write mCheated, mProgress, or mRemixEdited. A tally starts with three indeterminate fields.

Ghidra address:
NTSC-U/C: 0x0010f150
Ghidra address:
PAL: 0x0010f5b0

◆ ~GameStats()

virtual GameStats::~GameStats ( )
virtual

Release the three vectors.

The GameStats unit also emits an unreferenced, byte-identical copy at 0x0010fda0.

Ghidra address:
NTSC-U/C: 0x0010b648
Ghidra address:
PAL: 0x0010b7d0

Member Function Documentation

◆ Reset()

void GameStats::Reset ( int nPlayers)

Clear the tally for a new game and give each player a zero entry in every vector.

The title is inferred.

Parameters
nPlayersThe number of players.
Ghidra address:
NTSC-U/C: 0x0010f1a8
Ghidra address:
PAL: 0x0010f608

◆ GetScore()

int GameStats::GetScore ( int nPlayer)
Parameters
nPlayerThe player's index.
Returns
The player's final score.
Ghidra address:
NTSC-U/C: 0x0010ff20
Ghidra address:
PAL: 0x00110380

◆ SetScore()

void GameStats::SetScore ( int nPlayer,
int nScore )
Parameters
nPlayerThe player's index.
nScoreThe player's final score.
Ghidra address:
NTSC-U/C: 0x0010ff38
Ghidra address:
PAL: 0x00110398

◆ GetProgress()

float GameStats::GetProgress ( )
Returns
The fraction of the song reached, 1.0 when it was completed.
Ghidra address:
NTSC-U/C: 0x0010ff50
Ghidra address:
PAL: 0x001103b0

◆ SetProgress()

void GameStats::SetProgress ( float flProgress)
Parameters
flProgressThe fraction of the song reached.
Ghidra address:
NTSC-U/C: 0x0010ff58
Ghidra address:
PAL: 0x001103b8

◆ GetRatio()

float GameStats::GetRatio ( int nPlayer)
Parameters
nPlayerThe player's index.
Returns
The player's Player::GetCaptureRatio() fraction at the end of the game.
Ghidra address:
NTSC-U/C: 0x0010ff60
Ghidra address:
PAL: 0x001103c0

◆ SetRatio()

void GameStats::SetRatio ( int nPlayer,
float flRatio )
Parameters
nPlayerThe player's index.
flRatioThe player's Player::GetCaptureRatio() fraction.
Ghidra address:
NTSC-U/C: 0x0010ff78
Ghidra address:
PAL: 0x001103d8

◆ GetTally()

int GameStats::GetTally ( int nPlayer)
Parameters
nPlayerThe player's index.
Returns
The player's Player::GetBestStreak() count at the end of the game.
Ghidra address:
NTSC-U/C: 0x0010ff90
Ghidra address:
PAL: 0x001103f0

◆ SetTally()

void GameStats::SetTally ( int nPlayer,
int nTally )
Parameters
nPlayerThe player's index.
nTallyThe player's Player::GetBestStreak() count.
Ghidra address:
NTSC-U/C: 0x0010ffa8
Ghidra address:
PAL: 0x00110408

◆ GrooveWorld

friend class GrooveWorld
friend

Member Data Documentation

◆ mPlayerCount

int GameStats::mPlayerCount

The number of players the session records.

Public because MetMultiStatsScreen::EnterAndShow() reads it directly, and the image has no accessor. +0x00

◆ mCompleted

int GameStats::mCompleted

Non-zero when the solo song was completed.

Public because Gamer writes it directly at 0x00111b9c, and the image has no accessor. +0x04

◆ mCheated

int GameStats::mCheated

Non-zero when a cheat ran during the solo game, copied from Gamer::mCheated.

MetRenderer shows the stage-finish screen only for a completed game with this clear. Public because Gamer writes it directly at 0x00111ba8, and the image has no accessor. Not written by the constructor. +0x08

◆ mRemixEdited

int GameStats::mRemixEdited

Non-zero once the jam's phrases or remix effects changed.

Not written by the constructor.

GrooveWorld::MarkStatsFlag() sets it whenever PhraseMgr adds, installs, or clears a phrase and whenever JamEffectsMgr applies a statistics-counted effect. Public because MetRenderer::OnFreqEnded() reads it directly at 0x0036c138, where a non-zero value sends a finished jam to the end screen rather than MetRemixTypeScreen, and the image has no accessor. +0x14


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