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

Interface of the store a player draws powerups from. More...

#include <powerupcollectioni.h>

Inheritance diagram for PowerupCollectionI:
Collaboration diagram for PowerupCollectionI:

Public Member Functions

 PowerupCollectionI ()
virtual ~PowerupCollectionI ()
virtual void Add (PowerupType type)
 Store one powerup of the requested kind.
virtual void SelectRelative (int nDelta)
 Move the selection by one step, skipping an empty entry.
virtual void Select (int nIndex)
 Select one entry by index.
virtual void Deploy (int nTrack, int nBar)
 Deploy the selected powerup and account for the one used.
virtual int HasSelection () const
 Report whether an entry is selected.
virtual void SendState () const
 Send the whole state again, for a listener that has just registered.
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.

Additional Inherited Members

Public Attributes inherited from MsgSource
int mGraphBuilt
 A word no member of this class reads.

Detailed Description

Interface of the store a player draws powerups from.

Its RTTI descriptor is at 0x008f0030. It has MsgSource as its one base at offset 0. The trailing letter belongs to the name the descriptor records rather than being a suffix this tree added. Its table is at 0x007e49d8 and has ten entries with a zero terminator at index 10. Slots 2 and 3 retain the MsgSource pair at 0x0054a270 and 0x0054a2f0, and the six slots after them are this class's own.

The class adds no data member. Its constructor stores the table pointer at +0x10 and does nothing else, so the object is the same 0x14 bytes MsgSource occupies. The destructor restores the MsgSource table and expands the base destructor, and nothing of its own remains in the body.

Every one of the six virtuals below is a two-instruction jr ra default, so an unoverridden slot does nothing. The two subclasses are PowerupCollection, which stores one entry per kind with a count, and SinglePowerupCollection, which stores one powerup at a time. LocalPlayer chooses between the two in its constructor at 0x0011e000 and stores the result at its own +0xa4.

Every method name here is inferred from the two subclass implementations. No method name survives anywhere in the image. The verb of each slot is recovered, so a name describing the behaviour is written rather than a slot number.

Constructor & Destructor Documentation

◆ PowerupCollectionI()

PowerupCollectionI::PowerupCollectionI ( )
Ghidra address:
NTSC-U/C: 0x001cc7d0
Ghidra address:
PAL: 0x001d2688

◆ ~PowerupCollectionI()

virtual PowerupCollectionI::~PowerupCollectionI ( )
virtual
Ghidra address:
NTSC-U/C: 0x001cca90
Ghidra address:
PAL: 0x001d2948

Member Function Documentation

◆ Add()

virtual void PowerupCollectionI::Add ( PowerupType type)
virtual

Store one powerup of the requested kind.

Slot 4, and an empty default.

Parameters
typeThe kind, as Powerup::Type() reports it.
Ghidra address:
NTSC-U/C: 0x001ccb40
Ghidra address:
PAL: 0x001d29f8

Reimplemented in PowerupCollection, and SinglePowerupCollection.

◆ SelectRelative()

virtual void PowerupCollectionI::SelectRelative ( int nDelta)
virtual

Move the selection by one step, skipping an empty entry.

Slot 5, and an empty default. PowerupCollection::Add() calls it with 1 once a first powerup arrives with nothing selected.

Parameters
nDeltaThe step, which the one implementation applies as an addition.
Ghidra address:
NTSC-U/C: 0x001ccb48
Ghidra address:
PAL: 0x001d2a00

Reimplemented in PowerupCollection, and SinglePowerupCollection.

◆ Select()

virtual void PowerupCollectionI::Select ( int nIndex)
virtual

Select one entry by index.

Slot 6, and an empty default.

Parameters
nIndexThe entry, or -1 for none.
Ghidra address:
NTSC-U/C: 0x001ccb50
Ghidra address:
PAL: 0x001d2a08

Reimplemented in PowerupCollection, and SinglePowerupCollection.

◆ Deploy()

virtual void PowerupCollectionI::Deploy ( int nTrack,
int nBar )
virtual

Deploy the selected powerup and account for the one used.

Slot 7, and an empty default. Both implementations forward the two arguments untouched to Powerup::Deploy(). PowerupPlacer's three subclasses all dispatch this slot with two arguments, at 0x001ccf30, 0x001cdeb8, and 0x001cdfe0.

Parameters
nTrackWhatever Player::GetTrack() reports for the deploying player, its track. The default in Player returns -1.
nBarThe current bar, as the song tick divided by 1920.
Ghidra address:
NTSC-U/C: 0x001ccb58
Ghidra address:
PAL: 0x001d2a10

Reimplemented in PowerupCollection, and SinglePowerupCollection.

◆ HasSelection()

virtual int PowerupCollectionI::HasSelection ( ) const
virtual

Report whether an entry is selected.

Slot 8, and an empty default. The default leaves the return register untouched, so the value it yields is indeterminate and the base is not meant to be called. The return type comes from the two implementations, which both compute a truth value into the register.

Returns
Non-zero once an entry is selected.
Ghidra address:
NTSC-U/C: 0x001ccb60
Ghidra address:
PAL: 0x001d2a18

Reimplemented in PowerupCollection, and SinglePowerupCollection.

◆ SendState()

virtual void PowerupCollectionI::SendState ( ) const
virtual

Send the whole state again, for a listener that has just registered.

Slot 9, and an empty default.

Ghidra address:
NTSC-U/C: 0x001ccb68
Ghidra address:
PAL: 0x001d2a20

Reimplemented in PowerupCollection, and SinglePowerupCollection.


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