resonance 1.0.1
Loading...
Searching...
No Matches
catchmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include "mid/tick.h"
4#include "msg/message.h"
5
6class Player;
7
24class CatchMsg : public Message {
25public:
33 }
34
51 CatchMsg(int nTick, int nTrack, int nGem, int nHit, Player *pPlayer, int nCaught, int nTotal)
52 : mTick(nTick), mTrack(nTrack), mGem(nGem), mHit(nHit), mPlayer(pPlayer), mCaught(nCaught),
53 mTotal(nTotal) {
54 }
55
65 static Message *New();
66
74 virtual Message *Clone();
75
83 virtual int Type();
84
92 virtual const char *GetName() const;
93
95 int mTrack;
96 int mGem;
97 int mHit;
99 int mCaught;
100 int mTotal;
101};
102
113extern int g_nCatchMsgType;
int g_nCatchMsgType
Identity that CatchMsg::Type() reports.
int mTick
Definition catchmsg.h:94
virtual int Type()
Report this message's registered identity.
int mTotal
Definition catchmsg.h:100
CatchMsg()
Construct a message with the payload unset.
Definition catchmsg.h:32
CatchMsg(int nTick, int nTrack, int nGem, int nHit, Player *pPlayer, int nCaught, int nTotal)
Report a caught or missed gem.
Definition catchmsg.h:51
virtual const char * GetName() const
Report this message's class name.
int mGem
Definition catchmsg.h:96
int mCaught
Definition catchmsg.h:99
int mTrack
Definition catchmsg.h:95
static Message * New()
Produce a default-constructed message on the heap.
virtual Message * Clone()
Produce a heap copy of this message.
Player * mPlayer
Definition catchmsg.h:98
int mHit
Definition catchmsg.h:97
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
One participant in a session, local or remote.
Definition player.h:39
constexpr int kTickInfinity
Position the printer renders as positive infinity.
Definition tick.h:15