60 : mResult(nResult), mScores(scores) {
69 void *
operator new(
size_t nSize) {
70 return PoolMemAlloc(
static_cast<int>(nSize),
"GameEndedMsg", 0);
78 void operator delete(
void *pBlock) {
106 return "GameEndedMsg";
139 std::vector<NetGameScore> mScores;
GameEndedMsg(int nResult, const std::vector< NetGameScore > &scores)
Construct a message with the final scores.
Definition gameendedmsg.h:59
int Type() override
Report this message's registered identity.
Definition gameendedmsg.h:96
void PrintExtra(PrnStream &stream) const override
Write the result, and the scores when there are any.
const char * GetName() const override
Report this message's class name.
Definition gameendedmsg.h:105
~GameEndedMsg() override=default
Destroy the object.
GameEndedMsg(const GameEndedMsg &other)=default
Copy another message.
const std::vector< NetGameScore > & GetScores() const
Definition gameendedmsg.h:133
Message * Clone() override
Produce a heap copy of this message.
Definition gameendedmsg.h:87
GameEndedMsg(int nResult)
Construct a message with no scores.
Definition gameendedmsg.h:48
Result
Values of mResult.
Definition gameendedmsg.h:34
@ kResultConnectionLost
Definition gameendedmsg.h:37
@ kResultBooted
Definition gameendedmsg.h:38
@ kResultHostAborted
Definition gameendedmsg.h:36
@ kResultFinished
Definition gameendedmsg.h:35
int GetResult() const
Definition gameendedmsg.h:128
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Text output stream.
Definition prnstream.h:16
int g_nGameEndedMsgType
Identity that GameEndedMsg::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.