resonance 1.0.1
Loading...
Searching...
No Matches
updatescorepacket.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
6
27public:
36
46 UpdateScorePacket(int nPlayerId, int nScoreDelta)
47 : mPlayerId(nPlayerId), mScoreDelta(nScoreDelta) {
48 }
49
60 static Message *New();
61
69 virtual Message *Clone();
70
78 virtual int Type();
79
87 virtual const char *GetName() const;
88
98 virtual void PrintExtra(std::ostream &stream) const;
99
109 virtual void saveGuts(OBStream &stream) const;
110
120 virtual void restoreGuts(IBStream &stream);
121
124
127};
128
138extern int g_nUpdateScorePacketType;
Input half of the byte stream interface.
Definition ibstream.h:36
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
Output half of the byte stream interface.
Definition obstream.h:25
ToAllOtherGameSystemsPacket()
Route the packet with the pair 2 and 3.
Definition toallothergamesystemspacket.h:21
UpdateScorePacket(int nPlayerId, int nScoreDelta)
Report a change to a player's score.
Definition updatescorepacket.h:46
static Message * New()
Produce a default-constructed packet on the heap.
int mPlayerId
The identifier of the scoring player.
Definition updatescorepacket.h:123
virtual const char * GetName() const
Report this packet's class name.
virtual int Type()
Report this packet's registered identity.
int mScoreDelta
The points to add.
Definition updatescorepacket.h:126
virtual void restoreGuts(IBStream &stream)
Read the packet back from a stream.
UpdateScorePacket()
Construct a packet with only the Packet words set.
Definition updatescorepacket.h:34
virtual Message * Clone()
Produce a heap copy of this packet.
virtual void saveGuts(OBStream &stream) const
Write the packet to a stream.
virtual void PrintExtra(std::ostream &stream) const
Write the payload to a diagnostic stream.
int g_nUpdateScorePacketType
Identity that UpdateScorePacket::Type() reports.