wavelength 1.0.0
Loading...
Searching...
No Matches
track.h
Go to the documentation of this file.
1#pragma once
2
3#include "game/btnevent.h"
5#include "game/stickevent.h"
6
7// Player and Track refer to each other.
8class Player;
9
18class Track {
19public:
27 explicit Track(int nIndex);
28
35 virtual ~Track() {
36 }
37
39 virtual void Start() = 0;
40
42 virtual void Stop() = 0;
43
51 virtual void SetPlayer(Player *pPlayer);
52
59 virtual void HandleInput(Player *pPlayer, const PlayNoteEvent &event) = 0;
60
67 virtual void HandleInput(Player *pPlayer, const BtnEvent<8> &event) = 0;
68
75 virtual void HandleInput(Player *pPlayer, const StickEvent<2> &event) = 0;
76
83 virtual void HandleInput(Player *pPlayer, const StickEvent<6> &event) = 0;
84
91 virtual void HandleInput(Player *pPlayer, const BtnEvent<10> &event) = 0;
92
94 int GetIndex() const {
95 return mIndex;
96 }
97
99 Player *GetPlayer() const {
100 return mPlayer;
101 }
102
103protected:
104 int mIndex;
106};
Input event of a button press that names only the player.
Definition btnevent.h:15
Input event that plays a note on one of the three gem buttons.
Definition playnoteevent.h:10
One participant in a song: the track the participant plays, the score, and the streak.
Definition player.h:19
Input event of an analog stick position.
Definition stickevent.h:15
virtual ~Track()
Release the track.
Definition track.h:35
Track(int nIndex)
Construct a track with no player.
virtual void HandleInput(Player *pPlayer, const BtnEvent< 10 > &event)=0
Act on a button event of a player on this track.
virtual void HandleInput(Player *pPlayer, const BtnEvent< 8 > &event)=0
Act on a button event of a player on this track.
virtual void HandleInput(Player *pPlayer, const StickEvent< 6 > &event)=0
Act on a stick event of a player on this track.
Player * GetPlayer() const
Definition track.h:99
virtual void Stop()=0
Stop the track with the song.
virtual void HandleInput(Player *pPlayer, const StickEvent< 2 > &event)=0
Act on a stick event of a player on this track.
virtual void SetPlayer(Player *pPlayer)
Assign the player, and record the assignment in the session statistics.
virtual void HandleInput(Player *pPlayer, const PlayNoteEvent &event)=0
Act on a note a player played on this track.
virtual void Start()=0
Start the track with the song.
int mIndex
Definition track.h:104
int GetIndex() const
Definition track.h:94
Player * mPlayer
Definition track.h:105