resonance 1.0.1
Loading...
Searching...
No Matches
WinMsg Class Reference

Event the game passes between a MsgSource and a MsgSink. More...

#include <winmsg.h>

Inheritance diagram for WinMsg:
Collaboration diagram for WinMsg:

Public Member Functions

 WinMsg ()
 Construct a message with no winners.
virtual Message * Clone ()
 Produce a heap copy of this message.
virtual int Type ()
 Report this message's registered identity.
virtual const char * GetName () const
 Report this message's class name.
void AddWinner (Player *pPlayer)
 Append one winning player.
Public Member Functions inherited from Message
void * operator new (size_t nSize)
 Allocate a message from the tagged heap under the tag MSG.
void operator delete (void *pBlock)
 Release a message to the tagged heap under the tag MSG.
virtual ~Message ()
 Vtable slot 1.
virtual void PrintExtra (std::ostream &stream) const
 Write this message's payload to a stream.
virtual void saveGuts (OBStream &stream) const
 Write this message's payload to an output stream.
virtual void restoreGuts (IBStream &stream)
 Read this message's payload from an input stream.
std::ostream & Print (std::ostream &stream) const
 Write this message to a diagnostic stream as {GetName() PrintExtra()}.

Static Public Member Functions

static Message * New ()
 Produce a default-constructed message on the heap.
Static Public Member Functions inherited from Message
static Message * NewMessage (int nType)
 Produce a message of the identified class through the factory list.

Public Attributes

std::vector< Player * > mWinners

Detailed Description

Event the game passes between a MsgSource and a MsgSink.

Its RTTI descriptor is at 0x008f09d0. It has Message as its one base. The object is 0x10 bytes and its vtable is at 0x007ce690. The allocation in New() and the allocation in Clone() report the same size.

The payload layout comes from the run of field copies in Clone(). The vector at +0x04 comes from the copy constructor at 0x00116eb8, which allocates one element for every element of the source and moves them with a block copy. Its three words are the start, the finish, and the end of storage.

The vector is public because two handlers outside the class read it directly with no accessor in the image. Overlay::OnWin() at 0x0041e020 searches it for HudTrack::mPlayer with std::find at 0x0041e1d0. That search types the elements as players. TnlArena::DispatchPriv() tests the vector for emptiness.

The destructors at 0x00116238 and 0x003e0c00 are compiler-generated, release mWinners, and have no declaration here. The routine at 0x001162f0 is a further emission of the type-information accessor.

Constructor & Destructor Documentation

◆ WinMsg()

WinMsg::WinMsg ( )
inline

Construct a message with no winners.

Inline, with no address of its own. New() and Gamer's stack builds at 0x0011196c and 0x00112170 expand it, storing the table and three zero words.

Member Function Documentation

◆ New()

Message * WinMsg::New ( )
static

Produce a default-constructed message on the heap.

The translation unit at 0x003d9818 registers this factory against identity 421.

Returns
The message.
Ghidra address:
NTSC-U/C: 0x003d78c0
Ghidra address:
PAL: 0x0040f7c0

◆ Clone()

virtual Message * WinMsg::Clone ( )
virtual

Produce a heap copy of this message.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x00116368
Ghidra address:
PAL: 0x00116810

Implements Message.

◆ Type()

virtual int WinMsg::Type ( )
virtual

Report this message's registered identity.

Returns
g_nWinMsgType.
Ghidra address:
NTSC-U/C: 0x001163e0
Ghidra address:
PAL: 0x00116888

Implements Message.

◆ GetName()

virtual const char * WinMsg::GetName ( ) const
virtual

Report this message's class name.

Returns
The literal WinMsg.
Ghidra address:
NTSC-U/C: 0x001163f0
Ghidra address:
PAL: 0x00116898

Implements Message.

◆ AddWinner()

void WinMsg::AddWinner ( Player * pPlayer)
inline

Append one winning player.

Inline. The one out-of-line copy sits at 0x00116400 in Gamer's translation unit, which calls it after building the message on its stack at 0x00112170. The body is mWinners.push_back(), growing the vector through 0x00112cd8 when it is full.

Parameters
pPlayerThe winner.
Ghidra address:
NTSC-U/C: 0x00116400
Ghidra address:
PAL: 0x001168a8

Member Data Documentation

◆ mWinners

std::vector<Player *> WinMsg::mWinners

The winning players. +0x04


The documentation for this class was generated from the following file: