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

One participant in a song: the track the participant plays, the score, and the streak. More...

#include <player.h>

Inheritance diagram for Player:
Collaboration diagram for Player:

Public Member Functions

 Player (int nIndex, int nTicksPerBar)
 Construct a player with no track, no score, no streak, and no power-up.
virtual ~Player ()
 Cancel the multiplier power-up's end and release its command.
virtual void SetTrack (Track *pTrack)
 Move to a track and log the move.
virtual void HidePowerup ()
 Hide the player's power-up icon.
virtual void CancelMultiplier ()
 Withdraw the scheduled end of the multiplier power-up.
virtual void SetScore (int nScore)
 Set the score and show it.
virtual void AddScore (int nPoints)
 Add points to the score and show the new score.
virtual void CommitPendingPoints (bool bHide)
 Add the pending points to the score and clear them.
virtual void LosePendingPoints ()
 Forfeit the pending points.
virtual void ActivateMultiplier ()
 Start the multiplier power-up and schedule its end.
virtual void SetCatching (bool bCatching)
 Set whether the player is catching.
virtual void SetRepeat (bool bRepeat)
 Set the remix repeat state.
virtual int GetPadNum () const
 Report the controller port of the player.
int GetIndex () const
 Report the player's index.
int GetScore () const
 Report the score.
bool IsAborted () const
 Report whether the player left the song.
Track * GetTrack () const
 Report the player's track.
void HandleInput (const PlayNoteEvent &event)
 Hand a note event to the player's track.
void HandleInput (const BtnEvent< 10 > &event)
 Hand a button event to the player's track.
void HandleInput (const BtnEvent< 8 > &event)
 Hand a button event to the player's track.
void HandleInput (const StickEvent< 2 > &event)
 Hand a stick event to the player's track.
void HandleInput (const StickEvent< 6 > &event)
 Hand a stick event to the player's track.
void Abort ()
 Mark the player as having left the song.
void SetPendingPoints (int nPoints, bool bHide)
 Set the pending points and show them scaled by the multiplier power-up value.
void EndMultiplier ()
 End the multiplier power-up.
void SetStreak (int nStreak)
 Set the streak and show the streak multipliers it earns.
void IncrementStreak ()
 Lengthen the streak by one.
void ResetStreak ()
 Reset the streak to zero.
int GetStreak () const
 Report the streak.
bool GetCatching () const
 Report whether the player is catching.
int GetPowerup () const
 Report the kind of power-up the player holds.
void SetPowerup (int nPowerup)
 Record the kind of power-up the player holds and show it.
bool GetRepeat () const
 Report the remix repeat state.
int StreakMultiplier (int nStreak) const
 Report the streak multiplier a streak earns.
int GetLastHitTick () const
void SetLastHitTick (int nTick)

Protected Attributes

int mIndex
int mTicksPerBar
Track * mTrack
int mScore
int mPendingPoints
int mMultiplierValue
int mStreak
int mCatching
int mAborted
int mRepeat
int mLastHitTick
Ptr< Command > mMultiplierEndCommand
int mPowerup

Detailed Description

One participant in a song: the track the participant plays, the score, and the streak.

The RTTI includes the class name. The class has no base. LocalPlayer derives from it for a player on this console, and RemotePlayer for a player on another console. A player's points accumulate as pending points while a phrase is played, and CommitPendingPoints() adds them to the score scaled by the streak multiplier and the multiplier power-up, or LosePendingPoints() forfeits them. Every change is shown through TheGfxManager.

Constructor & Destructor Documentation

◆ Player()

Player::Player ( int nIndex,
int nTicksPerBar )

Construct a player with no track, no score, no streak, and no power-up.

Parameters
nIndexThe player's index.
nTicksPerBarThe song ticks in one bar, which time the multiplier power-up.
Ghidra address:
NTSC-U/C: 0x0012d9b0
Ghidra address:
PAL: 0x0012f188

◆ ~Player()

virtual Player::~Player ( )
virtual

Cancel the multiplier power-up's end and release its command.

Ghidra address:
NTSC-U/C: 0x0012da40
Ghidra address:
PAL: 0x0012f218

Member Function Documentation

◆ SetTrack()

virtual void Player::SetTrack ( Track * pTrack)
virtual

Move to a track and log the move.

Parameters
pTrackThe track.
Ghidra address:
NTSC-U/C: 0x0012daa0
Ghidra address:
PAL: 0x0012f278

Reimplemented in LocalPlayer.

◆ HidePowerup()

virtual void Player::HidePowerup ( )
virtual

Hide the player's power-up icon.

mPowerup is unchanged.

Ghidra address:
NTSC-U/C: 0x0012dae8
Ghidra address:
PAL: 0x0012f2c0

◆ CancelMultiplier()

virtual void Player::CancelMultiplier ( )
virtual

Withdraw the scheduled end of the multiplier power-up.

Ghidra address:
NTSC-U/C: 0x0012db10
Ghidra address:
PAL: 0x0012f2e8

◆ SetScore()

virtual void Player::SetScore ( int nScore)
virtual

Set the score and show it.

Parameters
nScoreThe score.
Ghidra address:
NTSC-U/C: 0x0012dc70
Ghidra address:
PAL: 0x0012f448

Reimplemented in LocalPlayer.

◆ AddScore()

virtual void Player::AddScore ( int nPoints)
virtual

Add points to the score and show the new score.

Parameters
nPointsThe points.
Ghidra address:
NTSC-U/C: 0x0012dcb0
Ghidra address:
PAL: 0x0012f488

Reimplemented in LocalPlayer.

◆ CommitPendingPoints()

virtual void Player::CommitPendingPoints ( bool bHide)
virtual

Add the pending points to the score and clear them.

The points added are the pending points times the multiplier power-up value times the streak multiplier. A capture worth no points shows the pending points as cleared rather than captured.

Parameters
bHideWhether the pending points display is hidden after a capture worth points.
Ghidra address:
NTSC-U/C: 0x0012dd80
Ghidra address:
PAL: 0x0012f558

◆ LosePendingPoints()

virtual void Player::LosePendingPoints ( )
virtual

Forfeit the pending points.

Ghidra address:
NTSC-U/C: 0x0012de40
Ghidra address:
PAL: 0x0012f618

◆ ActivateMultiplier()

virtual void Player::ActivateMultiplier ( )
virtual

Start the multiplier power-up and schedule its end.

The power-up lasts GameConfig::mMultiplierDurationBars bars from the current tick. A power-up already running is restarted.

Ghidra address:
NTSC-U/C: 0x0012de78
Ghidra address:
PAL: 0x0012f650

Reimplemented in LocalPlayer.

◆ SetCatching()

virtual void Player::SetCatching ( bool bCatching)
virtual

Set whether the player is catching.

Parameters
bCatchingWhether the player is catching.
Ghidra address:
NTSC-U/C: 0x0012e0c8
Ghidra address:
PAL: 0x0012f8a0

Reimplemented in LocalPlayer.

◆ SetRepeat()

virtual void Player::SetRepeat ( bool bRepeat)
virtual

Set the remix repeat state.

Parameters
bRepeatThe state.
Ghidra address:
NTSC-U/C: 0x0012e150
Ghidra address:
PAL: 0x0012f928

Reimplemented in LocalPlayer.

◆ GetPadNum()

virtual int Player::GetPadNum ( ) const
inlinevirtual

Report the controller port of the player.

Returns
-1, because a player of this class has no controller.
Ghidra address:
NTSC-U/C: 0x0033dbd0
Ghidra address:
PAL: 0x003ab108

Reimplemented in LocalPlayer.

◆ GetIndex()

int Player::GetIndex ( ) const
inline

Report the player's index.

Returns
The index.

◆ GetScore()

int Player::GetScore ( ) const
inline

Report the score.

Returns
The score.

◆ IsAborted()

bool Player::IsAborted ( ) const
inline

Report whether the player left the song.

Returns
Whether Abort() ran.

◆ GetTrack()

Track * Player::GetTrack ( ) const

Report the player's track.

Returns
The track, or null.
Ghidra address:
NTSC-U/C: 0x0012dae0
Ghidra address:
PAL: 0x0012f2b8

◆ HandleInput() [1/5]

void Player::HandleInput ( const PlayNoteEvent & event)

Hand a note event to the player's track.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x0012db48
Ghidra address:
PAL: 0x0012f320

◆ HandleInput() [2/5]

void Player::HandleInput ( const BtnEvent< 10 > & event)

Hand a button event to the player's track.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x0012db80
Ghidra address:
PAL: 0x0012f358

◆ HandleInput() [3/5]

void Player::HandleInput ( const BtnEvent< 8 > & event)

Hand a button event to the player's track.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x0012dbb8
Ghidra address:
PAL: 0x0012f390

◆ HandleInput() [4/5]

void Player::HandleInput ( const StickEvent< 2 > & event)

Hand a stick event to the player's track.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x0012dbf0
Ghidra address:
PAL: 0x0012f3c8

◆ HandleInput() [5/5]

void Player::HandleInput ( const StickEvent< 6 > & event)

Hand a stick event to the player's track.

Parameters
eventThe event.
Ghidra address:
NTSC-U/C: 0x0012dc28
Ghidra address:
PAL: 0x0012f400

◆ Abort()

void Player::Abort ( )

Mark the player as having left the song.

Ghidra address:
NTSC-U/C: 0x0012dc60
Ghidra address:
PAL: 0x0012f438

◆ SetPendingPoints()

void Player::SetPendingPoints ( int nPoints,
bool bHide )

Set the pending points and show them scaled by the multiplier power-up value.

Parameters
nPointsThe points.
bHideWhether a display of zero points is hidden as well as cleared.
Ghidra address:
NTSC-U/C: 0x0012dcf0
Ghidra address:
PAL: 0x0012f4c8

◆ EndMultiplier()

void Player::EndMultiplier ( )

End the multiplier power-up.

The command that ActivateMultiplier() schedules calls this.

Ghidra address:
NTSC-U/C: 0x0012df80
Ghidra address:
PAL: 0x0012f758

◆ SetStreak()

void Player::SetStreak ( int nStreak)

Set the streak and show the streak multipliers it earns.

Parameters
nStreakThe streak.
Ghidra address:
NTSC-U/C: 0x0012e008
Ghidra address:
PAL: 0x0012f7e0

◆ IncrementStreak()

void Player::IncrementStreak ( )

Lengthen the streak by one.

Ghidra address:
NTSC-U/C: 0x0012e080
Ghidra address:
PAL: 0x0012f858

◆ ResetStreak()

void Player::ResetStreak ( )

Reset the streak to zero.

Ghidra address:
NTSC-U/C: 0x0012e0a0
Ghidra address:
PAL: 0x0012f878

◆ GetStreak()

int Player::GetStreak ( ) const

Report the streak.

Returns
The streak.
Ghidra address:
NTSC-U/C: 0x0012e0c0
Ghidra address:
PAL: 0x0012f898

◆ GetCatching()

bool Player::GetCatching ( ) const

Report whether the player is catching.

Returns
Whether the player is catching.
Ghidra address:
NTSC-U/C: 0x0012e0d0
Ghidra address:
PAL: 0x0012f8a8

◆ GetPowerup()

int Player::GetPowerup ( ) const

Report the kind of power-up the player holds.

GameLogic::OnDeployPowerup() selects the deployment by the value.

Returns
One of GameLogic::Powerup, or GameLogic::kPowerupNone.
Ghidra address:
NTSC-U/C: 0x0012e0d8
Ghidra address:
PAL: 0x0012f8b0

◆ SetPowerup()

void Player::SetPowerup ( int nPowerup)

Record the kind of power-up the player holds and show it.

A power-up gained is reported to TheGameCallback when one is installed.

Parameters
nPowerupOne of GameLogic::Powerup, or GameLogic::kPowerupNone.
Ghidra address:
NTSC-U/C: 0x0012e0e0
Ghidra address:
PAL: 0x0012f8b8

◆ GetRepeat()

bool Player::GetRepeat ( ) const

Report the remix repeat state.

Returns
The state.
Ghidra address:
NTSC-U/C: 0x0012e148
Ghidra address:
PAL: 0x0012f920

◆ StreakMultiplier()

int Player::StreakMultiplier ( int nStreak) const

Report the streak multiplier a streak earns.

The multiplier is one more than the streak, capped at GameConfig::mStreakMultiplierMaxSolo with one player and at GameConfig::mStreakMultiplierMaxMulti otherwise.

Parameters
nStreakThe streak.
Returns
The multiplier.
Ghidra address:
NTSC-U/C: 0x0012e158
Ghidra address:
PAL: 0x0012f930

◆ GetLastHitTick()

int Player::GetLastHitTick ( ) const
inline
Returns
The tick of the last gem hit, or -1.

◆ SetLastHitTick()

void Player::SetLastHitTick ( int nTick)
inline
Parameters
nTickThe tick of the last gem hit.

Member Data Documentation

◆ mIndex

int Player::mIndex
protected

The player's index.

◆ mTicksPerBar

int Player::mTicksPerBar
protected

The song ticks in one bar.

◆ mTrack

Track* Player::mTrack
protected

The track the player plays, or null.

◆ mScore

int Player::mScore
protected

The score.

◆ mPendingPoints

int Player::mPendingPoints
protected

The points of the phrase being played.

◆ mMultiplierValue

int Player::mMultiplierValue
protected

1, or the multiplier power-up value.

◆ mStreak

int Player::mStreak
protected

The streak.

◆ mCatching

int Player::mCatching
protected

Whether the player is catching.

◆ mAborted

int Player::mAborted
protected

Whether the player has left the song.

◆ mRepeat

int Player::mRepeat
protected

The remix repeat state.

◆ mLastHitTick

int Player::mLastHitTick
protected

The tick of the last gem hit, or -1.

◆ mMultiplierEndCommand

Ptr<Command> Player::mMultiplierEndCommand
protected

The command that calls EndMultiplier().

◆ mPowerup

int Player::mPowerup
protected

The kind of power-up the player holds.


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