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

Stand-in for an absent player. More...

#include <nullplayer.h>

Inheritance diagram for NullPlayer:
Collaboration diagram for NullPlayer:

Public Member Functions

 NullPlayer ()
 Build the stand-in.
virtual int IsNull ()
 Report that this player is a stand-in.
virtual void DispatchPriv (Message *message)
Public Member Functions inherited from Player
 Player (int nId, const HxStr &colorName, const FreqAppearance *pAppearance)
 Register the player under its identifier and start its tallies.
virtual ~Player ()
virtual int GetInputSlot () const
 Report the controller slot that drives this player.
virtual int GetTrack ()
 Report the track this player occupies.
virtual int GetPlace ()
 Report the player's place on its track.
virtual int UnusedQuery ()
 Report zero.
virtual void UnusedHook ()
 Do nothing.
virtual void SetFreestyleSpan (int nStartBar, int nEndBar)
 Give the player a span of bars it plays freely.
virtual int IsFreestyleBar (int nBar)
 Test whether a bar lies in the player's freestyle span.
virtual int IsLooping ()
 Report whether the player is looping.
virtual void AnnounceState ()
 Announce the player's state.
virtual void DeactivatePlacer ()
 Deactivate the powerup placer.
virtual void Print (std::ostream &stream)
 Write a description of this player to stream.
virtual int CountCaughtGem ()
 Count one caught gem.
virtual int CountMissedGem ()
 Count one missed gem.
virtual int GetMultiplier (int nBar)
 Report the score multiplier a capture starting at a bar earns.
virtual int GetBestStreak ()
 Report the best streak of consecutive captures.
virtual float GetCaptureRatio ()
 Report the proportion of captured phrases among those captured and muffed.
virtual int GetGameMode ()
 Report the game mode the player was built in.
virtual int MarkBarScored (int nBar)
 Record that a bar scored, reporting whether it had not scored before.
int GetJuice ()
 Report the juice the player has banked.
int GetScore ()
 Report the player's score.
void SetScore (int nScore, int nMaxScore)
 Set the score and the ceiling it is clamped to.
void SetJuice (int nJuice, int nMaxJuice)
 Set the juice and the ceiling it is clamped to.
void AddJuice (int nAmount, int bNotify)
 Add juice, clamped to 0 through the ceiling, and announce a change.
void AddScore (int nDelta, int bNotify)
 Add to the score, clamped to 0 through the ceiling, and announce a change.
void OnMsg (const PhraseCapturedMsg &msg)
 Add a captured phrase's score and juice, announcing both.
int IsLocal () const
 Report whether the player has an input slot.
HxStr GetColorName ()
 Copy the player's colour name.
HxStr GetUsername ()
 Copy the username of the player's appearance.
int StartMF ()
 Run AnnounceState() and report zero.
int StopMF ()
 Run DeactivatePlacer() and report zero.
Public Member Functions inherited from IDable< Player >
 IDable (int nId)
 Register the object in sObjects under an identifier.
virtual ~IDable ()
 Release the table slot this object occupies.
Public Member Functions inherited from IDableBase
virtual ~IDableBase ()
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the tagged heap under the tag "MsgSink".
void operator delete (void *pBlock)
 Release a sink to the tagged heap.
virtual ~MsgSink ()
virtual void Dispatch (Message *pMsg)
 Accept a message.
Public Member Functions inherited from MsgSource
virtual ~MsgSource ()
virtual void AddSink (MsgSink *pSink)
 Register a sink, ignoring a sink that is already registered.
virtual void RemoveSink (MsgSink *pSink)
 Unregister the first occurrence of a sink.
void Send (Message *pMsg) const
 Deliver a message to every registered sink, in registration order.
void ClearSinks ()
 Unregister every sink.

Static Public Attributes

static NullPlayer sInstance
 Stand-in every unoccupied player reference stores.
Static Public Attributes inherited from IDable< Player >
static std::vector< Player * > sObjects
 Every registered object, indexed by mId.

Additional Inherited Members

Static Public Member Functions inherited from Player
static void Delete (Player *pPlayer)
 Delete a player through its virtual destructor, doing nothing for null.
Public Attributes inherited from Player
int mPlayerId
 Identifier a message addresses this player by.
HxStr mColorName
 The player's colour name, such as green or red.
long long mLastEraseTime
 Scheduler time of this player's last erase press, in nanoseconds.
Public Attributes inherited from MsgSource
int mGraphBuilt
 A word no member of this class reads.
Protected Attributes inherited from Player
int mMaxJuice
int mMaxScore
Protected Attributes inherited from IDableBase
int mId

Detailed Description

Stand-in for an absent player.

NullPlayer in the RTTI descriptor at 0x008ef210, with Player as its only base. Its three vtables are at 0x007d24e0, 0x007d24b8, and 0x007d2490, each walked to its terminator.

The primary table has 21 entries, the same as the base, so this class adds no virtual. It replaces one primary slot, IsNull at index 3, and DispatchPriv in its MsgSink table, which it empties so that the stand-in ignores every message. It inherits everything else. Two members against the base's nineteen is what makes this the null-object member of the family, and the base being an interface with inert defaults is what lets it be that small.

No destructor is declared here. The routine at 0x001324e8 occupies slot 1 of all three of this class's tables, so it is this class's destructor rather than a stray copy, and it is byte-identical to the base destructor because a trivial derived destructor stores its own table pointer, the inlined base destructor overwrites it, and the dead first store is dropped. The compiler therefore generates it from an implicit declaration and the source owes no definition.

The two routines at 0x00133528 and 0x00133530 sit at the same index, 3, in two different tables, the MsgSink one and the primary one.

Constructor & Destructor Documentation

◆ NullPlayer()

NullPlayer::NullPlayer ( )

Build the stand-in.

The image has no out-of-line constructor. Its static initialiser writes the tables and members directly, which this constructor performs through the base with an unregistered identifier, no colour, and no appearance.

Member Function Documentation

◆ IsNull()

virtual int NullPlayer::IsNull ( )
virtual

Report that this player is a stand-in.

Returns 1 where the base returns 0, which is the whole of what makes this the null member of the family.

Returns
Always non-zero.
Ghidra address:
NTSC-U/C: 0x00133530
Ghidra address:
PAL: 0x00133d98

Reimplemented from Player.

◆ DispatchPriv()

virtual void NullPlayer::DispatchPriv ( Message * message)
virtual
Ghidra address:
NTSC-U/C: 0x00133528
Ghidra address:
PAL: 0x00133d90

Reimplemented from Player.

Member Data Documentation

◆ sInstance

NullPlayer NullPlayer::sInstance
static

Stand-in every unoccupied player reference stores.

The Player translation unit's static initialiser at 0x00132618 builds it, alongside the IDable<Player> table at 0x0066f920. Its 27 readers across the image include TrackSelector, Catcher, PhraseMgr, PitchPicker, Phrase, and AxeNewGemMaker, none of which is in the unit that builds it.

Ghidra address:
NTSC-U/C: 0x0066f930
Ghidra address:
PAL: 0x006b0520

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