50 : mTrack(nTrack), mPoints(nPoints), mCatching(bCatching), mVersion(nVersion) {
68 void *
operator new(
size_t nSize) {
69 return PoolMemAlloc(
static_cast<int>(nSize),
"PlayerUpdatePacket", 0);
77 void operator delete(
void *pBlock) {
111 return "PlayerUpdatePacket";
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
ExternalPacket(unsigned char nFlags=0, int nReceiver=kAllPeers)
Construct a packet from an unset sender.
Definition externalpacket.h:21
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
void PrintExtra(PrnStream &stream) const override
Print the track, the score, the catching state, and the version.
static Message * New()
Produce a default-constructed packet on the heap.
const char * GetName() const override
Report this packet's class name.
Definition playerupdatepacket.h:110
int Type() override
Report this packet's registered identity.
Definition playerupdatepacket.h:99
int GetTrack() const
Definition playerupdatepacket.h:155
int GetPoints() const
Definition playerupdatepacket.h:150
void restoreGuts(BinStream &stream) override
Read the word saveGuts() writes back into the fields.
PlayerUpdatePacket()
Construct a packet with no track and no score.
Definition playerupdatepacket.h:36
PlayerUpdatePacket(int nTrack, int nPoints, bool bCatching, int nVersion)
Construct a packet with every field set.
Definition playerupdatepacket.h:49
~PlayerUpdatePacket() override=default
Destroy the object.
Message * Clone() override
Produce a heap copy of this packet.
Definition playerupdatepacket.h:88
void saveGuts(BinStream &stream) const override
Write the fields packed into one word.
int GetVersion() const
Definition playerupdatepacket.h:160
int GetCatching() const
Definition playerupdatepacket.h:145
Text output stream.
Definition prnstream.h:16
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.
int g_nPlayerUpdatePacketType
Identity that PlayerUpdatePacket::Type() reports.