resonance 1.0.1
Loading...
Searching...
No Matches
phrasecapturedmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
5#include "msg/message.h"
6
7class Player;
8
27class PhraseCapturedMsg : public Message {
28public:
37
54 PhraseCapturedMsg(int nFirstBar,
55 int nEndBar,
56 int nRunFirstBar,
57 int nRunEndBar,
58 int nTrack,
59 Player *pPlayer,
60 int nScore,
61 int nJuice,
62 int bExtendsStreak)
63 : mFirstBar(nFirstBar), mEndBar(nEndBar), mRunFirstBar(nRunFirstBar),
64 mRunEndBar(nRunEndBar), mTrack(nTrack), mPlayer(pPlayer), mScore(nScore), mJuice(nJuice),
65 mExtendsStreak(bExtendsStreak) {
66 }
67
77 static Message *New();
78
86 virtual Message *Clone();
87
95 virtual int Type();
96
104 virtual const char *GetName() const;
105
114 virtual void PrintExtra(std::ostream &stream) const;
115
123
124private:
125 int mEndBar; // +0x08, written after `--` by PrintExtra()
126
127public:
128 // Public because LocalPlayer::DispatchPriv() reads both directly at `0x0011ee88` and
129 // `0x0011ef0c`, and the image has no accessor.
132 int mTrack;
134 int mScore;
135
143
152};
153
164extern int g_nPhraseCapturedMsgType;
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
virtual int Type()
Report this message's registered identity.
int mRunFirstBar
Definition phrasecapturedmsg.h:130
virtual Message * Clone()
Produce a heap copy of this message.
int mTrack
Definition phrasecapturedmsg.h:132
static Message * New()
Produce a default-constructed message on the heap.
int mRunEndBar
Definition phrasecapturedmsg.h:131
int mFirstBar
The first bar of the captured phrase, which PrintExtra() writes ahead of --.
Definition phrasecapturedmsg.h:122
virtual void PrintExtra(std::ostream &stream) const
Write b , the bar range joined by --, tr# , the track, score , the score, juice ,...
int mScore
Definition phrasecapturedmsg.h:134
Player * mPlayer
Definition phrasecapturedmsg.h:133
virtual const char * GetName() const
Report this message's class name.
int mJuice
The juice the capture earned, a value SingleCatcher reads from its TrackData.
Definition phrasecapturedmsg.h:142
int mExtendsStreak
Non-zero when the capture extends the player's streak of consecutive captures.
Definition phrasecapturedmsg.h:151
PhraseCapturedMsg()
Construct a message with the payload unset.
Definition phrasecapturedmsg.h:35
PhraseCapturedMsg(int nFirstBar, int nEndBar, int nRunFirstBar, int nRunEndBar, int nTrack, Player *pPlayer, int nScore, int nJuice, int bExtendsStreak)
Report a captured phrase.
Definition phrasecapturedmsg.h:54
One participant in a session, local or remote.
Definition player.h:39
int g_nPhraseCapturedMsgType
Identity that PhraseCapturedMsg::Type() reports.