wavelength 1.0.0
Loading...
Searching...
No Matches
gameparamsupdatemsg.h
Go to the documentation of this file.
1#pragma once
2
3#include "msg/message.h"
6#include "os/mem.h"
7
15public:
22 ~GameParamsUpdateMsg() override = default;
23
31 explicit GameParamsUpdateMsg(const NetGameParams &params) : mParams(params) {
32 }
33
40 void *operator new(size_t nSize) {
41 return PoolMemAlloc(static_cast<int>(nSize), "GameParamsUpdateMsg", 0);
42 }
43
49 void operator delete(void *pBlock) {
50 PoolMemFree(pBlock);
51 }
52
58 Message *Clone() override {
59 return new GameParamsUpdateMsg(*this);
60 }
61
67 int Type() override {
69 }
70
76 const char *GetName() const override {
77 return "GameParamsUpdateMsg";
78 }
79
87 void PrintExtra(PrnStream &stream) const override;
88
90 const NetGameParams &GetParams() const {
91 return mParams;
92 }
93
94private:
95 NetGameParams mParams;
96};
const NetGameParams & GetParams() const
Definition gameparamsupdatemsg.h:90
int Type() override
Report this message's registered identity.
Definition gameparamsupdatemsg.h:67
Message * Clone() override
Produce a heap copy of this message.
Definition gameparamsupdatemsg.h:58
const char * GetName() const override
Report this message's class name.
Definition gameparamsupdatemsg.h:76
void PrintExtra(PrnStream &stream) const override
Write the settings.
GameParamsUpdateMsg(const NetGameParams &params)
Construct a message with the settings.
Definition gameparamsupdatemsg.h:31
~GameParamsUpdateMsg() override=default
Destroy the object.
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
The settings of an online game that the host publishes with its session.
Definition netgameparams.h:13
Text output stream.
Definition prnstream.h:16
int g_nGameParamsUpdateMsgType
Identity that GameParamsUpdateMsg::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.