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

Player on this console, controlled through one controller port. More...

#include <localplayer.h>

Inheritance diagram for LocalPlayer:
Collaboration diagram for LocalPlayer:

Public Member Functions

 LocalPlayer (int nIndex, int nTicksPerBar, int nPadNum)
 Construct a player for a controller port.
 ~LocalPlayer () override
 Release the broadcast command.
void SetTrack (Track *pTrack) override
 Move to a track, move this player's count in TheMixer from the old track to the new one, and broadcast.
void SetScore (int nScore) override
 Set the score, show it, and broadcast.
void AddScore (int nPoints) override
 Add points to the score, show the new score, and broadcast.
void ActivateMultiplier () override
 Start the multiplier power-up and, in an online session, announce it with a MultiplierPacket.
void SetCatching (bool bCatching) override
 Set whether the player is catching, and broadcast when it changes.
void SetRepeat (bool bRepeat) override
 Set the remix repeat state and broadcast.
int GetPadNum () const override
 Report the controller port of the player.
virtual void Capture ()
 Add the pending points to the score, hide the pending points, and broadcast.
void Broadcast ()
 Send this player's state to the other consoles and schedule the next broadcast.
Public Member Functions inherited from Player
 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 HidePowerup ()
 Hide the player's power-up icon.
virtual void CancelMultiplier ()
 Withdraw the scheduled end of the multiplier power-up.
virtual void CommitPendingPoints (bool bHide)
 Add the pending points to the score and clear them.
virtual void LosePendingPoints ()
 Forfeit the pending points.
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)

Static Public Attributes

static int sPlayerUpdateVersion
 Sequence number of the last PlayerUpdatePacket sent.
static int sRemixerUpdateVersion
 Sequence number of the last RemixerUpdatePacket sent.

Additional Inherited Members

Protected Attributes inherited from Player
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

Player on this console, controlled through one controller port.

The RTTI records the class as deriving from Player. In an online session every change to the track, the score, the catching state, or the repeat state is sent to the other consoles through Broadcast(), which also repeats itself every 500 milliseconds.

Constructor & Destructor Documentation

◆ LocalPlayer()

LocalPlayer::LocalPlayer ( int nIndex,
int nTicksPerBar,
int nPadNum )

Construct a player for a controller port.

Parameters
nIndexThe player's index.
nTicksPerBarThe song ticks in one bar.
nPadNumThe controller port.
Ghidra address:
NTSC-U/C: 0x001225e0
Ghidra address:
PAL: 0x00123d60

◆ ~LocalPlayer()

LocalPlayer::~LocalPlayer ( )
override

Release the broadcast command.

Ghidra address:
NTSC-U/C: 0x00122650
Ghidra address:
PAL: 0x00123dd0

Member Function Documentation

◆ SetTrack()

void LocalPlayer::SetTrack ( Track * pTrack)
overridevirtual

Move to a track, move this player's count in TheMixer from the old track to the new one, and broadcast.

Parameters
pTrackThe track.
Ghidra address:
NTSC-U/C: 0x001226a0
Ghidra address:
PAL: 0x00123e20

Reimplemented from Player.

◆ SetScore()

void LocalPlayer::SetScore ( int nScore)
overridevirtual

Set the score, show it, and broadcast.

Parameters
nScoreThe score.
Ghidra address:
NTSC-U/C: 0x00122710
Ghidra address:
PAL: 0x00123e90

Reimplemented from Player.

◆ AddScore()

void LocalPlayer::AddScore ( int nPoints)
overridevirtual

Add points to the score, show the new score, and broadcast.

Parameters
nPointsThe points.
Ghidra address:
NTSC-U/C: 0x00122740
Ghidra address:
PAL: 0x00123ec0

Reimplemented from Player.

◆ ActivateMultiplier()

void LocalPlayer::ActivateMultiplier ( )
overridevirtual

Start the multiplier power-up and, in an online session, announce it with a MultiplierPacket.

Ghidra address:
NTSC-U/C: 0x001227e0
Ghidra address:
PAL: 0x00123f60

Reimplemented from Player.

◆ SetCatching()

void LocalPlayer::SetCatching ( bool bCatching)
overridevirtual

Set whether the player is catching, and broadcast when it changes.

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

Reimplemented from Player.

◆ SetRepeat()

void LocalPlayer::SetRepeat ( bool bRepeat)
overridevirtual

Set the remix repeat state and broadcast.

Parameters
bRepeatThe state.
Ghidra address:
NTSC-U/C: 0x00122868
Ghidra address:
PAL: 0x00123fe8

Reimplemented from Player.

◆ GetPadNum()

int LocalPlayer::GetPadNum ( ) const
inlineoverridevirtual

Report the controller port of the player.

Returns
mPadNum.
Ghidra address:
NTSC-U/C: 0x0033ac40
Ghidra address:
PAL: 0x003a8178

Reimplemented from Player.

◆ Capture()

virtual void LocalPlayer::Capture ( )
virtual

Add the pending points to the score, hide the pending points, and broadcast.

Ghidra address:
NTSC-U/C: 0x00122770
Ghidra address:
PAL: 0x00123ef0

◆ Broadcast()

void LocalPlayer::Broadcast ( )

Send this player's state to the other consoles and schedule the next broadcast.

Only an online session broadcasts. The game and duel rule sets send a PlayerUpdatePacket, the remix rule set sends a RemixerUpdatePacket, and any other rule set sends nothing. A broadcast already scheduled is withdrawn first, and the next one is scheduled 500 milliseconds later.

Ghidra address:
NTSC-U/C: 0x00122898
Ghidra address:
PAL: 0x00124018

Member Data Documentation

◆ sPlayerUpdateVersion

int LocalPlayer::sPlayerUpdateVersion
static

Sequence number of the last PlayerUpdatePacket sent.

Ghidra address:
NTSC-U/C: 0x003af764
Ghidra address:
PAL: 0x0042e5fc

◆ sRemixerUpdateVersion

int LocalPlayer::sRemixerUpdateVersion
static

Sequence number of the last RemixerUpdatePacket sent.

Ghidra address:
NTSC-U/C: 0x003af768
Ghidra address:
PAL: 0x0042e600

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