resonance 1.0.1
Loading...
Searching...
No Matches
powerupcountmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include "msg/message.h"
4
5class Player;
6
20class PowerupCountMsg : public Message {
21public:
30
40 static Message *New();
41
54 PowerupCountMsg(int nIndex, int nCount, Player *pOwner);
55
63 virtual Message *Clone();
64
72 virtual int Type();
73
81 virtual const char *GetName() const;
82
90 virtual void PrintExtra(std::ostream &stream) const;
91
92private:
93 // The three names come from PowerupCollection, the one producer of the message, which writes
94 // the entry index, the count after the change, and the owning player into them in this order.
95 int mIndex; // +0x04
96 int mCount; // +0x08
97 Player *mOwner; // +0x0c
98};
99
110extern int g_nPowerupCountMsgType;
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
virtual void PrintExtra(std::ostream &stream) const
Write the entry and the count to a diagnostic stream, separated by /.
PowerupCountMsg()
Construct a message with the payload unset.
Definition powerupcountmsg.h:28
virtual int Type()
Report this message's registered identity.
PowerupCountMsg(int nIndex, int nCount, Player *pOwner)
Report a new stored count for one entry of a player's collection.
virtual Message * Clone()
Produce a heap copy of this message.
virtual const char * GetName() const
Report this message's class name.
static Message * New()
Produce a default-constructed message on the heap.
int g_nPowerupCountMsgType
Identity that PowerupCountMsg::Type() reports.