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

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

#include <erasemsg.h>

Inheritance diagram for EraseMsg:
Collaboration diagram for EraseMsg:

Public Member Functions

 EraseMsg ()
 Construct a message with the position at kTickInfinity and the rest unset.
 EraseMsg (Player *pPlayer, Sch::Tick position, int nTrack, int nDoubleTap)
 Report an erase press.
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 position and the player's colour name, separated by a space, 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

Player * mPlayer
Sch::Tick mPosition
int mTrack
int mDoubleTap

Static Public Attributes

static int sID
 Identity that Type() reports.

Detailed Description

Event the game passes between a MsgSource and a MsgSink.

Its RTTI descriptor is at 0x00901cf0. It has Message as its one base. The object is 0x14 bytes and its vtable is at 0x00813160. 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(). InputMap::OnControllerReading(), the one builder, stores the resolved player, the controller reading's position, the track the player's slot 4 reports, and a double-tap flag. The flag is set when the press falls within 400,000,000 of the previous press time the player stores at +0x40, and Scratcher widens the erased range to the whole section when it is set.

PrintExtra() hands +0x08 to Sch::Tick::Print() and writes the colour name of the player at +0x04, which types both. New() initialises the position to kTickInfinity.

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

Constructor & Destructor Documentation

◆ EraseMsg() [1/2]

EraseMsg::EraseMsg ( )
inline

Construct a message with the position at kTickInfinity and the rest unset.

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

◆ EraseMsg() [2/2]

EraseMsg::EraseMsg ( Player * pPlayer,
Sch::Tick position,
int nTrack,
int nDoubleTap )
inline

Report an erase press.

Inline, with no address of its own. InputMap::OnControllerReading() at 0x00119aa0 expands it on its stack. The four arguments are the four members in declaration order.

Parameters
pPlayerThe player the controller belongs to.
positionThe song position of the reading.
nTrackThe player's track.
nDoubleTapNon-zero when the press follows the previous one closely.

Member Function Documentation

◆ New()

Message * EraseMsg::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: 0x003d6b28
Ghidra address:
PAL: 0x0040ea18

◆ Clone()

virtual Message * EraseMsg::Clone ( )
virtual

Produce a heap copy of this message.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003db3e0
Ghidra address:
PAL: 0x00413818

Implements Message.

◆ Type()

virtual int EraseMsg::Type ( )
virtual

Report this message's registered identity.

Returns
sID.
Ghidra address:
NTSC-U/C: 0x003db440
Ghidra address:
PAL: 0x00413878

Implements Message.

◆ GetName()

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

Report this message's class name.

Returns
The literal EraseMsg.
Ghidra address:
NTSC-U/C: 0x003db450
Ghidra address:
PAL: 0x00413888

Implements Message.

◆ PrintExtra()

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

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

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

Reimplemented from Message.

Member Data Documentation

◆ sID

int EraseMsg::sID
static

Identity that Type() reports.

Ghidra address:
NTSC-U/C: 0x006d0174
Ghidra address:
PAL: 0x0071390c

◆ mPlayer

Player* EraseMsg::mPlayer

◆ mPosition

Sch::Tick EraseMsg::mPosition

◆ mTrack

int EraseMsg::mTrack

◆ mDoubleTap

int EraseMsg::mDoubleTap

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