61 explicit BarData(
int nTrack) : mTrack(nTrack) {
309 void SetPaused(
bool bPaused,
int nPad,
int nReason)
override;
394 static float CueOffsetY(
bool bSecondSide);
448 void StartFirstPhrase();
458 void ShowNextPhrase(
int nBar,
int nPhase);
478 bool IsBarSkipped(
int nBar)
const;
488 int AdvancePhrase(
int nBar);
497 bool CheckForWinner();
508 void PlayMissSound();
527 void AdvanceSection(
int nBar);
537 void OnPhraseCueTick();
547 void OnSoundCueTick();
558 unsigned char GetTrackVolume(
int nTrack,
bool bMuted);
567 void ApplyBarTrack(
int nBar);
576 void DecideDuel(
bool bLocalWinner);
586 void AnnounceWinner();
595 bool AllScoresReceived()
const;
613 void LogEndMultiGame();
684 int mStateBeforePause;
688 int mCommandsStopped;
700 int mSectionStartBar;
703 std::vector<std::unique_ptr<Player>> mPlayers;
704 std::vector<std::unique_ptr<DuelTrack>> mTracks;
705 std::vector<std::unique_ptr<CatchTrackData>> mGems;
706 std::unique_ptr<GameTrackSelector> mTrackSelector;
707 std::vector<int> mInputPlayers;
708 std::vector<std::unique_ptr<PitchTrack>> mPitchTracks;
718 std::vector<unsigned int> mUpdateVersions;
719 std::vector<int> mSeatPlayers;
720 std::vector<bool> mScoresReceived;
721 std::vector<BarData> mBarData;
723 int mOneLetterPlayed;
Input event of a button press that names only the player.
Definition btnevent.h:15
Packet that reports a phrase of a track captured by a player on another console.
Definition capturepacket.h:20
The gems of one catch track, in the order of their ticks.
Definition catchtrackdata.h:14
Input event that changes the section a player is on.
Definition changesectionevent.h:10
void HandleInput(const StickEvent< 6 > &event) override
Ignore a stick event of command 6.
float GetProgress() override
Report the fraction of the song played.
State
Values of mState.
Definition duellogic.h:38
@ kStatePaused
Definition duellogic.h:41
@ kStateFinished
Definition duellogic.h:44
@ kStateDecided
Definition duellogic.h:42
@ kStatePlaying
Definition duellogic.h:40
@ kStateEnding
Definition duellogic.h:43
@ kStateNone
Definition duellogic.h:39
bool IsFinished() const override
Report whether the duel ended.
void HandleInput(const ChangeSectionEvent &event) override
Ignore a section change.
Definition duellogic.h:247
void SetPaused(bool bPaused, int nPad, int nReason) override
Pause or resume the duel.
void HandleInput(const BtnEvent< 4 > &event) override
Ignore a button event of command 4.
void Poll() override
Finish the duel once the song has faded out and the outro is done.
bool IsPlaying() const override
Report whether the song plays.
Definition duellogic.h:318
bool DispatchPriv(Message *pMsg) override
Act on a message sent to the rules.
void HandleInput(const BtnEvent< 5 > &event) override
Ignore a button event of command 5.
bool IsFreestyling(int nPlayer) override
Report that no player freestyles.
Definition duellogic.h:156
int GetBarInstrument(int nBar)
Report the instrument of the song track the duel plays in a bar.
void Start() override
Start the music, set the first roles, and schedule the commands of the duel.
int HasQuit() const override
Report whether a player abandoned the duel from a menu.
void HandleInput(const StickEvent< 2 > &event) override
Ignore a stick event of command 2.
void HandleInput(const RotateEvent &event) override
Ignore a rotation.
void HandleInput(const BtnEvent< 8 > &event) override
Ignore a button event of command 8.
Definition duellogic.h:277
void HandleInput(const PlayNoteEvent &event) override
Hand a gem button to the player who pressed it while the song plays.
void StartEnding()
Fade the song out and schedule the end of the duel.
void Stop() override
End the duel.
Phase
Values of mPhase and mCuePhase.
Definition duellogic.h:48
@ kPhaseBreak
Definition duellogic.h:51
@ kPhasePitch
Definition duellogic.h:49
@ kPhaseCatch
Definition duellogic.h:50
void HandleInput(const BtnEvent< 3 > &event) override
Pause the duel while the song plays.
~DuelLogic() override
Release the rules.
int IsRestartRequested() const override
Report that no restart was requested.
Definition duellogic.h:144
float GetTime() override
Report the song position on the song clock.
void OnCatchMade(DuelTrack *pTrack, Player *pPlayer, bool bReact)
Score a made catch for the catcher.
void RewindCatcherTrack()
Move the playback of the catcher's track to the current song position.
void OnCatchMissed(DuelTrack *pTrack, Player *pPlayer, int nBar)
Score a missed catch for the pitcher.
int GetPlayerSide(int nPlayer) const
Report the side of a player.
void HandleInput(const BtnEvent< 10 > &event) override
Ignore a button event of command 10.
Definition duellogic.h:267
DuelLogic(Song *pSong)
Construct the rules for a song.
void HandleInput(const BtnEvent< 9 > &event) override
Ignore a button event of command 9.
Definition duellogic.h:257
int GetTick() override
Report the song position in ticks.
Track of one player in a duel, on which the player places a phrase or catches the phrase the other pl...
Definition dueltrack.h:35
Packet that reports a gem placed or removed in the remix editor.
Definition editgempacket.h:20
Packet that reports a player's score at the end of a song to the hosting console.
Definition finalscorepacket.h:20
Message that reports the end of an online session, with the final scores.
Definition gameendedmsg.h:23
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
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
Message that reports a player leaving an online session.
Definition playerabortedmsg.h:20
Packet that reports a local player's track, score, and catching state to the other consoles.
Definition playerupdatepacket.h:21
One participant in a song: the track the participant plays, the score, and the streak.
Definition player.h:19
Owner of one reference to an Attachment.
Definition ptr.h:16
Input event that rotates a player's view of the tracks by one track.
Definition rotateevent.h:11
One song: its configuration from the song text file and the tracks its MIDI file builds.
Definition song.h:38
Input event of an analog stick position.
Definition stickevent.h:15
WorldLogic()
Construct the logic and give the input of every controller to the world.
int GetTrack() const
Definition duellogic.h:65
BarData(int nTrack)
Construct the data for a bar.
Definition duellogic.h:61