|
wavelength 1.0.0
|
One participant in a song: the track the participant plays, the score, and the streak. More...
#include <player.h>


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 |
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.
| Player::Player | ( | int | nIndex, |
| int | nTicksPerBar ) |
Construct a player with no track, no score, no streak, and no power-up.
| nIndex | The player's index. |
| nTicksPerBar | The song ticks in one bar, which time the multiplier power-up. |
|
virtual |
Cancel the multiplier power-up's end and release its command.
|
virtual |
Move to a track and log the move.
| pTrack | The track. |
Reimplemented in LocalPlayer.
|
virtual |
Hide the player's power-up icon.
mPowerup is unchanged.
|
virtual |
Withdraw the scheduled end of the multiplier power-up.
|
virtual |
Set the score and show it.
| nScore | The score. |
Reimplemented in LocalPlayer.
|
virtual |
Add points to the score and show the new score.
| nPoints | The points. |
Reimplemented in LocalPlayer.
|
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.
| bHide | Whether the pending points display is hidden after a capture worth points. |
|
virtual |
Forfeit the pending points.
|
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.
Reimplemented in LocalPlayer.
|
virtual |
Set whether the player is catching.
| bCatching | Whether the player is catching. |
Reimplemented in LocalPlayer.
|
virtual |
Set the remix repeat state.
| bRepeat | The state. |
Reimplemented in LocalPlayer.
|
inlinevirtual |
Report the controller port of the player.
Reimplemented in LocalPlayer.
|
inline |
Report the player's index.
|
inline |
Report the score.
|
inline |
Report whether the player left the song.
| Track * Player::GetTrack | ( | ) | const |
Report the player's track.
| void Player::HandleInput | ( | const PlayNoteEvent & | event | ) |
Hand a note event to the player's track.
| event | The event. |
| void Player::HandleInput | ( | const BtnEvent< 10 > & | event | ) |
Hand a button event to the player's track.
| event | The event. |
| void Player::HandleInput | ( | const BtnEvent< 8 > & | event | ) |
Hand a button event to the player's track.
| event | The event. |
| void Player::HandleInput | ( | const StickEvent< 2 > & | event | ) |
Hand a stick event to the player's track.
| event | The event. |
| void Player::HandleInput | ( | const StickEvent< 6 > & | event | ) |
Hand a stick event to the player's track.
| event | The event. |
| void Player::Abort | ( | ) |
Mark the player as having left the song.
| void Player::SetPendingPoints | ( | int | nPoints, |
| bool | bHide ) |
Set the pending points and show them scaled by the multiplier power-up value.
| nPoints | The points. |
| bHide | Whether a display of zero points is hidden as well as cleared. |
| void Player::EndMultiplier | ( | ) |
End the multiplier power-up.
The command that ActivateMultiplier() schedules calls this.
| void Player::SetStreak | ( | int | nStreak | ) |
Set the streak and show the streak multipliers it earns.
| nStreak | The streak. |
| void Player::IncrementStreak | ( | ) |
Lengthen the streak by one.
| void Player::ResetStreak | ( | ) |
Reset the streak to zero.
| int Player::GetStreak | ( | ) | const |
Report the streak.
| bool Player::GetCatching | ( | ) | const |
Report whether the player is catching.
| int Player::GetPowerup | ( | ) | const |
Report the kind of power-up the player holds.
GameLogic::OnDeployPowerup() selects the deployment by the value.
| 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.
| nPowerup | One of GameLogic::Powerup, or GameLogic::kPowerupNone. |
| bool Player::GetRepeat | ( | ) | const |
Report the remix repeat state.
| 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.
| nStreak | The streak. |
|
inline |
|
inline |
| nTick | The tick of the last gem hit. |
|
protected |
The player's index.
|
protected |
The song ticks in one bar.
|
protected |
The track the player plays, or null.
|
protected |
The score.
|
protected |
The points of the phrase being played.
|
protected |
1, or the multiplier power-up value.
|
protected |
The streak.
|
protected |
Whether the player is catching.
|
protected |
Whether the player has left the song.
|
protected |
The remix repeat state.
|
protected |
The tick of the last gem hit, or -1.
The command that calls EndMultiplier().
|
protected |
The kind of power-up the player holds.