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

Store of one powerup at a time, which a new one replaces. More...

#include <singlepowerupcollection.h>

Inheritance diagram for SinglePowerupCollection:
Collaboration diagram for SinglePowerupCollection:

Public Member Functions

 SinglePowerupCollection (LocalPlayer *pOwner)
 Start with no powerup stored.
virtual ~SinglePowerupCollection ()
 Delete the stored powerup.
virtual void Add (PowerupType type)
 Replace the stored powerup with one of the requested kind.
virtual void SelectRelative (int nDelta)
 Do nothing.
virtual void Select (int nIndex)
 Do nothing.
virtual void Deploy (int nTrack, int nBar)
 Deploy the stored powerup and discard it.
virtual int HasSelection () const
 Report whether a powerup is stored.
virtual void SendState () const
 Send the stored kind again, for a listener that has just registered.
Public Member Functions inherited from PowerupCollectionI
 PowerupCollectionI ()
virtual ~PowerupCollectionI ()
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

Store of one powerup at a time, which a new one replaces.

Its RTTI descriptor is at 0x008efed0. It has PowerupCollectionI as its one base at offset 0. Its table is at 0x007e4850 and has ten entries with a zero terminator at index 10, the same length as the base table. The class adds no virtual.

It overrides the destructor and four of the base's six slots. Slots 5 and 6, SelectRelative() and Select(), point at two-instruction bodies of their own at 0x001cc9f0 and 0x001cc9f8, and this toolchain re-emits an inline empty body into every translation unit that needs one, so a unique address for an empty body is no evidence of an override. Both are recorded as inherited and neither is declared. Selecting has no meaning for a store of one.

The object is 0x20 bytes. The base occupies the first 0x14 including the inherited vptr at +0x10, and the three members below follow it.

LocalPlayer's constructor allocates one at 0x0011e170 for three of its modes and stores the pointer at its own +0xa4. Its remaining mode allocates a PowerupCollection instead.

Every method name is inferred from the bodies. No method name survives anywhere in the image.

Constructor & Destructor Documentation

◆ SinglePowerupCollection()

SinglePowerupCollection::SinglePowerupCollection ( LocalPlayer * pOwner)
explicit

Start with no powerup stored.

Parameters
pOwnerThe player whose collection this is.
Ghidra address:
NTSC-U/C: 0x001cb760
Ghidra address:
PAL: 0x001d1618

◆ ~SinglePowerupCollection()

virtual SinglePowerupCollection::~SinglePowerupCollection ( )
virtual

Delete the stored powerup.

Ghidra address:
NTSC-U/C: 0x001cb7b0
Ghidra address:
PAL: 0x001d1668

Member Function Documentation

◆ Add()

virtual void SinglePowerupCollection::Add ( PowerupType type)
virtual

Replace the stored powerup with one of the requested kind.

The powerup already stored is deleted first, whatever its kind, so a store of one never queues. A ChoosePowerupMsg follows with the new kind and an index of 0, the one slot of the store.

Parameters
typeThe kind.
Ghidra address:
NTSC-U/C: 0x001cb890
Ghidra address:
PAL: 0x001d1748

Reimplemented from PowerupCollectionI.

◆ SelectRelative()

virtual void SinglePowerupCollection::SelectRelative ( int nDelta)
virtual

Do nothing.

A store of one has no other entry to move to.

An empty override of its own at table slot 5, apart from the base's empty default.

Parameters
nDeltaNot read.
Ghidra address:
NTSC-U/C: 0x001cc9f0
Ghidra address:
PAL: 0x001d28a8

Reimplemented from PowerupCollectionI.

◆ Select()

virtual void SinglePowerupCollection::Select ( int nIndex)
virtual

Do nothing.

A store of one has no other entry to select.

An empty override of its own at table slot 6, apart from the base's empty default.

Parameters
nIndexNot read.
Ghidra address:
NTSC-U/C: 0x001cc9f8
Ghidra address:
PAL: 0x001d28b0

Reimplemented from PowerupCollectionI.

◆ Deploy()

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

Deploy the stored powerup and discard it.

An empty store returns with no message, and a powerup that reports failure keeps its place. A success sends a ChoosePowerupMsg with a kind of -1, then deletes the powerup and clears both members.

Parameters
nTrackForwarded to Powerup::Deploy(). See PowerupCollectionI::Deploy().
nBarForwarded to Powerup::Deploy(). See PowerupCollectionI::Deploy().
Ghidra address:
NTSC-U/C: 0x001cb948
Ghidra address:
PAL: 0x001d1800

Reimplemented from PowerupCollectionI.

◆ HasSelection()

virtual int SinglePowerupCollection::HasSelection ( ) const
virtual

Report whether a powerup is stored.

Returns
Non-zero unless the stored kind is -1.
Ghidra address:
NTSC-U/C: 0x001cca00
Ghidra address:
PAL: 0x001d28b8

Reimplemented from PowerupCollectionI.

◆ SendState()

virtual void SinglePowerupCollection::SendState ( ) const
virtual

Send the stored kind again, for a listener that has just registered.

An empty store sends nothing. The test goes through the virtual HasSelection() rather than reading the member.

Ghidra address:
NTSC-U/C: 0x001cba20
Ghidra address:
PAL: 0x001d18d8

Reimplemented from PowerupCollectionI.


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