wavelength 1.0.0
Loading...
Searching...
No Matches
loadgamepkt.h
Go to the documentation of this file.
1#pragma once
2
4#include "os/mem.h"
5
12extern int g_nLoadGamePktType;
13
22public:
29 ~LoadGamePkt() override = default;
30
38
46 static Message *New();
47
54 void *operator new(size_t nSize) {
55 return PoolMemAlloc(static_cast<int>(nSize), "LoadGamePkt", 0);
56 }
57
63 void operator delete(void *pBlock) {
64 PoolMemFree(pBlock);
65 }
66
74 Message *Clone() override {
75 return new LoadGamePkt(*this);
76 }
77
85 int Type() override {
86 return g_nLoadGamePktType;
87 }
88
96 const char *GetName() const override {
97 return "LoadGamePkt";
98 }
99};
InternalPacket(unsigned char nFlags=0, int nReceiver=kUnset)
Construct a packet from an unset sender.
Definition internalpacket.h:33
LoadGamePkt()
Construct a packet for every peer.
Definition loadgamepkt.h:36
static Message * New()
Produce a default-constructed packet on the heap.
int Type() override
Report this packet's registered identity.
Definition loadgamepkt.h:85
const char * GetName() const override
Report this packet's class name.
Definition loadgamepkt.h:96
~LoadGamePkt() override=default
Destroy the object.
Message * Clone() override
Produce a heap copy of this packet.
Definition loadgamepkt.h:74
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
static constexpr int kAllPeers
Value of mReceiver that addresses every peer.
Definition packet.h:19
int g_nLoadGamePktType
Identity that LoadGamePkt::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.