63 void *
operator new(
size_t nSize) {
64 return PoolMemAlloc(
static_cast<int>(nSize),
"FinalScorePacket", 0);
72 void operator delete(
void *pBlock) {
106 return "FinalScorePacket";
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
FinalScorePacket()
Construct a packet with no score.
Definition finalscorepacket.h:35
void SetScore(int nScore)
Definition finalscorepacket.h:133
int Type() override
Report this packet's registered identity.
Definition finalscorepacket.h:94
FinalScorePacket(int nScore)
Construct a packet with a score.
Definition finalscorepacket.h:45
Message * Clone() override
Produce a heap copy of this packet.
Definition finalscorepacket.h:83
int GetScore() const
Definition finalscorepacket.h:128
void saveGuts(BinStream &stream) const override
Write the score.
~FinalScorePacket() override=default
Destroy the object.
const char * GetName() const override
Report this packet's class name.
Definition finalscorepacket.h:105
void restoreGuts(BinStream &stream) override
Read the score.
static Message * New()
Produce a default-constructed packet on the heap.
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
static constexpr unsigned char kFlagGuaranteed
Bit of mFlags that NetTransport::Send() turns into its guaranteed delivery bit.
Definition packet.h:28
int g_nFinalScorePacketType
Identity that FinalScorePacket::Type() reports.
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.