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

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

#include <choosepowerupmsg.h>

Inheritance diagram for ChoosePowerupMsg:
Collaboration diagram for ChoosePowerupMsg:

Public Member Functions

 ChoosePowerupMsg ()
 Construct a message with the payload unset.
 ChoosePowerupMsg (int nIndex, Player *pOwner, int nType)
 Report a new selection in a player's collection.
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 selected entry to a diagnostic stream as a number.
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

Player * mOwner
int mType

Detailed Description

Event the game passes between a MsgSource and a MsgSink.

Its RTTI descriptor is at 0x008ef810. It has Message as its one base. The object is 0x10 bytes and its vtable is at 0x00812c48. 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(). mOwner and mType are public because Overlay::OnChoosePowerup() at 0x0041e9b8 reads both directly with no accessor in the image. It compares mOwner with HudTrack::mPlayer and passes mType to script template 1016. The selected entry is read only by PrintExtra() and remains private.

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

Constructor & Destructor Documentation

◆ ChoosePowerupMsg() [1/2]

ChoosePowerupMsg::ChoosePowerupMsg ( )
inline

Construct a message with the payload unset.

Inline. New() expands it and stores only the vtable pointer. A declaration is required because the class declares a second constructor.

◆ ChoosePowerupMsg() [2/2]

ChoosePowerupMsg::ChoosePowerupMsg ( int nIndex,
Player * pOwner,
int nType )

Report a new selection in a player's collection.

No address attaches to the constructor. The two collections build the message on their own stack at five sites, 0x001cb3e8, 0x001cb494, 0x001cb6e0, 0x001cb8d4, and 0x001cb98c, and hand the address to MsgSource::Send(). The compiler expands the constructor into each site. The three arguments are the three members in declaration order.

Parameters
nIndexThe selected entry, or 0 from SinglePowerupCollection, which stores one.
pOwnerThe player whose selection changed.
nTypeThe selected powerup's kind, or -1 for none.

Member Function Documentation

◆ New()

Message * ChoosePowerupMsg::New ( )
static

Produce a default-constructed message on the heap.

The translation unit at 0x003d9818 registers this factory.

Returns
The message.
Ghidra address:
NTSC-U/C: 0x003d6f90
Ghidra address:
PAL: 0x0040ee80

◆ Clone()

virtual Message * ChoosePowerupMsg::Clone ( )
virtual

Produce a heap copy of this message.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003dd0b8
Ghidra address:
PAL: 0x004154f0

Implements Message.

◆ Type()

virtual int ChoosePowerupMsg::Type ( )
virtual

Report this message's registered identity.

Returns
g_nChoosePowerupMsgType.
Ghidra address:
NTSC-U/C: 0x003dd110
Ghidra address:
PAL: 0x00415548

Implements Message.

◆ GetName()

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

Report this message's class name.

Returns
The literal ChoosePowerupMsg.
Ghidra address:
NTSC-U/C: 0x003dd120
Ghidra address:
PAL: 0x00415558

Implements Message.

◆ PrintExtra()

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

Write the selected entry to a diagnostic stream as a number.

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

Reimplemented from Message.

Member Data Documentation

◆ mOwner

Player* ChoosePowerupMsg::mOwner

The player whose selection changed. +0x08

◆ mType

int ChoosePowerupMsg::mType

The selected PowerupType value, or kHudItemNone. +0x0c


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