wavelength 1.0.0
Loading...
Searching...
No Matches
localplayer.h
Go to the documentation of this file.
1#pragma once
2
3#include "game/player.h"
4#include "game/track.h"
5#include "os/command.h"
6#include "os/ptr.h"
7
15class LocalPlayer : public Player {
16public:
26 LocalPlayer(int nIndex, int nTicksPerBar, int nPadNum);
27
34 ~LocalPlayer() override;
35
44 void SetTrack(Track *pTrack) override;
45
53 void SetScore(int nScore) override;
54
62 void AddScore(int nPoints) override;
63
71 void ActivateMultiplier() override;
72
80 void SetCatching(bool bCatching) override;
81
89 void SetRepeat(bool bRepeat) override;
90
98 int GetPadNum() const override {
99 return mPadNum;
100 }
101
108 virtual void Capture();
109
120 void Broadcast();
121
129
137
138private:
139 int mPadNum;
140 Ptr<Command> mBroadcastCommand;
141};
virtual void Capture()
Add the pending points to the score, hide the pending points, and broadcast.
void ActivateMultiplier() override
Start the multiplier power-up and, in an online session, announce it with a MultiplierPacket.
void SetTrack(Track *pTrack) override
Move to a track, move this player's count in TheMixer from the old track to the new one,...
void SetScore(int nScore) override
Set the score, show it, and broadcast.
static int sRemixerUpdateVersion
Sequence number of the last RemixerUpdatePacket sent.
Definition localplayer.h:136
LocalPlayer(int nIndex, int nTicksPerBar, int nPadNum)
Construct a player for a controller port.
void SetCatching(bool bCatching) override
Set whether the player is catching, and broadcast when it changes.
void AddScore(int nPoints) override
Add points to the score, show the new score, and broadcast.
void SetRepeat(bool bRepeat) override
Set the remix repeat state and broadcast.
int GetPadNum() const override
Report the controller port of the player.
Definition localplayer.h:98
static int sPlayerUpdateVersion
Sequence number of the last PlayerUpdatePacket sent.
Definition localplayer.h:128
~LocalPlayer() override
Release the broadcast command.
void Broadcast()
Send this player's state to the other consoles and schedule the next broadcast.
Player(int nIndex, int nTicksPerBar)
Construct a player with no track, no score, no streak, and no power-up.
Owner of one reference to an Attachment.
Definition ptr.h:16
One instrument track of the song that a player can play.
Definition track.h:18