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

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

#include <gemmsg.h>

Inheritance diagram for GemMsg:
Collaboration diagram for GemMsg:

Public Member Functions

 GemMsg ()
 Construct a message with only the position set, to kTickInfinity.
 GemMsg (Sch::Tick position, int nTrack, int nGem, Player *pPlayer, int nGhost=0)
 Report a gem played on a track.
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.
virtual void PrintExtra (std::ostream &stream) const
 Write the track, the position, the gem, and the player's colour name, separated by spaces, to a diagnostic stream.
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 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

Sch::Tick mPosition
int mTrack
int mGem
Player * mPlayer
int mGhost

Detailed Description

Event the game passes between a MsgSource and a MsgSink.

Its RTTI descriptor is at 0x00901b70. It has Message as its one base. The object is 0x18 bytes and its vtable is at 0x00812588. The members below are the whole of the class. No other routine in the image refers to this type by anything but its vtable.

The payload layout comes from the run of field copies in Clone(). PrintExtra() hands +0x04 to Sch::Tick::Print() and writes the colour name of the player at +0x10. The track at +0x08 and the gem at +0x0c are printed without labels, and the word at +0x14 is not printed. The two names come from Catcher::SimulateRemoteGem() at 0x001ace78, which stores the catcher's track and the gem TrackData::FindGemAtOrAfter() reports.

Every member is public because AppTunnel's gem handler at 0x00447638 reads all five directly with no accessor in the image. A non-zero mGhost selects the ghost gem there. Every stack build clears it except PhraseMgr::AddGem()'s at 0x001bae48, which stores its own flag.

The destructor at 0x003df450 is compiler-generated and has no declaration here.

Constructor & Destructor Documentation

◆ GemMsg() [1/2]

GemMsg::GemMsg ( )
inline

Construct a message with only the position set, to kTickInfinity.

Inline. New() expands it. A declaration is required because the class declares a second constructor.

◆ GemMsg() [2/2]

GemMsg::GemMsg ( Sch::Tick position,
int nTrack,
int nGem,
Player * pPlayer,
int nGhost = 0 )
inline

Report a gem played on a track.

Inline, with no address of its own. Every stack build in the image expands it. Most clear mGhost (Catcher::SimulateRemoteGem() at 0x001ad048, Catcher::CatchGem() at 0x001ac25c, PhraseMgr::PostGemMsg() at 0x001ba86c, and PhraseMgr::AddGem() at 0x001baed0), and PhraseMgr::AddGem()'s build at 0x001bae48 passes a flag of its own.

Parameters
positionThe song position of the gem.
nTrackThe track the gem lies on.
nGemThe gem.
pPlayerThe player who played it.
nGhostNon-zero for a ghost gem.

Member Function Documentation

◆ New()

Message * GemMsg::New ( )
static

Produce a default-constructed message on the heap.

The translation unit at 0x003d9818 registers this factory. Only the position is initialised.

Returns
The message.
Ghidra address:
NTSC-U/C: 0x003d74f8
Ghidra address:
PAL: 0x0040f3f8

◆ Clone()

virtual Message * GemMsg::Clone ( )
virtual

Produce a heap copy of this message.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003df540
Ghidra address:
PAL: 0x00417998

Implements Message.

◆ Type()

virtual int GemMsg::Type ( )
virtual

Report this message's registered identity.

Returns
g_nGemMsgType.
Ghidra address:
NTSC-U/C: 0x003df5a8
Ghidra address:
PAL: 0x00417a00

Implements Message.

◆ GetName()

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

Report this message's class name.

Returns
The literal GemMsg.
Ghidra address:
NTSC-U/C: 0x003df5b8
Ghidra address:
PAL: 0x00417a10

Implements Message.

◆ PrintExtra()

virtual void GemMsg::PrintExtra ( std::ostream & stream) const
virtual

Write the track, the position, the gem, and the player's colour name, separated by spaces, to a diagnostic stream.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x003d8830
Ghidra address:
PAL: 0x00410c48

Reimplemented from Message.

Member Data Documentation

◆ mPosition

Sch::Tick GemMsg::mPosition

The song position of the gem. +0x04

◆ mTrack

int GemMsg::mTrack

The track the gem lies on. +0x08

◆ mGem

int GemMsg::mGem

The gem, which AppTunnel uses as the lane. +0x0c

◆ mPlayer

Player* GemMsg::mPlayer

The player who played it. +0x10

◆ mGhost

int GemMsg::mGhost

Non-zero for a ghost gem. +0x14


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