73 const float *pTickDuration,
129 [[maybe_unused]]
const BtnEvent<8> &event)
override {
333 ~CatchReceiver()
override =
default;
340 explicit CatchReceiver(
DuelTrack *pOwner) : mOwner(pOwner) {
351 void OnHit(
int nTick,
const GemCursor &cursor)
override {
352 mOwner->
HitGem(nTick, cursor,
false);
363 void OnPass(
int nTick,
const GemCursor &cursor)
override {
364 mOwner->MissGem(nTick, cursor,
false);
375 void OnMiss(
int nTick,
int nLane)
override {
376 mOwner->OnPressMissed(nTick, nLane);
388 class PitchReceiver :
public DuelTrackPitcher::Receiver {
396 ~PitchReceiver()
override =
default;
403 explicit PitchReceiver(
DuelTrack *pOwner) : mOwner(pOwner) {
414 void OnRejected(
int nTick, [[maybe_unused]]
int nSlot)
override {
415 mOwner->OnPressRejected(nTick);
425 void OnPlaced(
int nTick)
override {
426 mOwner->OnGemPlaced(nTick);
442 void ShowBars(
int nMode,
int nStartBar,
int nEndBar);
452 bool IsLastGemOfBar(
const GemCursor &cursor);
460 void ShowCatchProgress();
470 void OnPressMissed(
int nTick,
int nLane);
479 void OnPressRejected(
int nTick);
490 void OnGemPlaced(
int nTick);
499 void CheckCatchMissed(
int nTick);
509 void CheckCatchMade(
const GemCursor &cursor,
bool bRemote);
521 std::unique_ptr<CatchReceiver> mCatchReceiver;
522 std::unique_ptr<PitchReceiver> mPitchReceiver;
523 DuelPatternTable *mPatterns;
529 int mFirstPhraseTick;
530 CatchTrackState mCatchState;
531 CatchTrackState mPitchState;
533 GemCatcher mGemCatcher;
534 DuelTrackPitcher mPitcher;
538 Ptr<Command> mPhraseCommand;
548 std::unique_ptr<NetFaker> mNetFaker;
Input event of a button press that names only the player.
Definition btnevent.h:15
The gems of one catch track, in the order of their ticks.
Definition catchtrackdata.h:14
Rules of the duel rule set.
Definition duellogic.h:35
The duel patterns of a song, each with the tick it applies from, embedded in the song at +0x20.
Definition duelpatterntable.h:14
void CountGem()
Count one more gem in the phrase to catch.
void HitGem(int nTick, const GemCursor &cursor, bool bRemote) override
Play the riff of a caught gem and show the catch.
void HandleInput(Player *pPlayer, const PlayNoteEvent &event) override
Hand a press of the player on the track to the pitcher or to the catcher.
void MissGem(int nTick, const GemCursor &cursor, bool bRemote) override
End the catch as missed when a gem of the phrase to catch passes without a press.
void HandleInput(Player *pPlayer, const BtnEvent< 8 > &event) override
Ignore a button event.
Definition dueltrack.h:128
void ShowPhrase(int nMode, int nStartBar, int nEndBar)
Show the bars of the next phrase.
void MakeCatch(int nBar)
End the current catch as made.
void HandleInput(Player *pPlayer, const StickEvent< 2 > &event) override
Ignore a stick event.
void HandleInput(Player *pPlayer, const StickEvent< 6 > &event) override
Ignore a stick event.
DuelTrack(DuelLogic *pLogic, Player *pPlayer, CatchTrackData *pCatchGems, CatchTrackData *pPitchGems, PitchTrackRiffData *pRiffData, DuelPatternTable *pPatterns, const float *pTickDuration, PlayMap *pPlayMap, SectionBoundaries *pSections, int nSide, int nOpponentSide, int nLeadInBars, int nNumBars, int nTicksPerBar, int nPhraseBars, bool bEasiest)
Construct the track of one player.
void DropBars(int nStartBar, int nEndBar)
Disable a range of bars the song has passed and remove the gems the range has.
void Start() override
Start the track with the song.
void HandleInput(Player *pPlayer, const BtnEvent< 10 > &event) override
Ignore a button event.
Definition dueltrack.h:160
void SetMode(int nMode, int nBar)
Change what the player does on the track.
Mode
The values of SetMode() and ShowPhrase().
Definition dueltrack.h:38
@ kModePitch
Definition dueltrack.h:40
@ kModeCatch
Definition dueltrack.h:41
@ kModeIdle
Definition dueltrack.h:39
void MissCatch()
End the current catch as missed.
~DuelTrack() override
Release the track.
Player * GetPlayer() const override
Report the player of the side the track belongs to.
Definition dueltrack.h:182
int GetTicksPerBar() const override
Report the song ticks in one bar.
Definition dueltrack.h:171
bool IsBarActive(int nBar) override
Report that the phrase of every bar can be played.
void Rewind()
Move the playback of the track to the current song position.
void SetRiffData(PitchTrackRiffData *pRiffData)
Change the riffs the gems the player places play.
GemCursor GetCursor() override
Report a cursor at the first gem the player catches.
void Stop() override
Stop the track with the song.
void CancelPhrase()
Withdraw the command that runs once per phrase.
Object told of each judged gem and press.
Definition gemcatcher.h:25
Position at one gem of a catch track, walked in the order the song plays the gems.
Definition gemcursor.h:14
The riffs a pitch track plays, one set of riffs for each tick that starts a set.
Definition pitchtrackriffdata.h:16
Map from the bars a song plays to the bars of the song as written, with the loops that repeat stretch...
Definition playmap.h:11
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
Ascending list of the measures at which the sections of a song end.
Definition sectionboundaries.h:12
Input event of an analog stick position.
Definition stickevent.h:15
Interface through which the rules react to the phrases of a player's track.
Definition trackreactor.h:12
Track(int nIndex)
Construct a track with no player.