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

Powerbar source that deals a powerbar to scattered bars of a track once, at construction. More...

#include <gamepowerbarmgr.h>

Inheritance diagram for GamePowerbarMgr:
Collaboration diagram for GamePowerbarMgr:

Classes

struct  Bar
 One bar's entry in mBars. More...

Public Member Functions

 GamePowerbarMgr (PlayMap *pMap, PhraseDatabase *pDatabase, const TrackData *pTrackData, int bRandomKind, int nTrack, int bMultiplayer, int nMinGap, int nMaxGap)
 Size mBars to the last step of the play map and deal the powerbars.
virtual int GetPowerbar (int nBar)
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

Powerbar source that deals a powerbar to scattered bars of a track once, at construction.

It has PowerbarMgr as its one base. Its table is at 0x007e3878. The allocations in PhraseMgr's routine at 0x001ba3d8 measure the object at 0x40 bytes for both subclasses. SoloPowerbarMgr and MultiPowerbarMgr differ only in the constant arguments their constructors pass here.

The deleting destructor at 0x001c6090 is implicitly declared.

Constructor & Destructor Documentation

◆ GamePowerbarMgr()

GamePowerbarMgr::GamePowerbarMgr ( PlayMap * pMap,
PhraseDatabase * pDatabase,
const TrackData * pTrackData,
int bRandomKind,
int nTrack,
int bMultiplayer,
int nMinGap,
int nMaxGap )

Size mBars to the last step of the play map and deal the powerbars.

Every draw comes from the R250 generator through RandomInt() and RandomFloat(). Starting at a bar drawn from [0, 10), the constructor visits bars at gaps drawn from [nMinGap, nMaxGap). A visited bar that has gems and whose next bar is not a step start gets a powerbar. With bRandomKind set the powerbar is 3 or 12 with even odds. Otherwise the bar's position through the track selects a row of the weighted table at 0x0068c790, and a second draw selects the powerbar within that row.

Parameters
pMapThe play map.
pDatabaseThe phrase database of the track.
pTrackDataThe track description.
bRandomKindNon-zero to choose between the two powerbars with even odds.
nTrackThe track's index.
bMultiplayerStored in mMultiplayer. SoloPowerbarMgr passes 0 and MultiPowerbarMgr 1.
nMinGapThe shortest gap between two dealt bars.
nMaxGapThe gap the draw stops below.
Ghidra address:
NTSC-U/C: 0x001c4fb0
Ghidra address:
PAL: 0x001cadf8

Member Function Documentation

◆ GetPowerbar()

virtual int GamePowerbarMgr::GetPowerbar ( int nBar)
virtual
Parameters
nBarThe bar.
Returns
The powerbar mBars records for the bar, or -1.
Ghidra address:
NTSC-U/C: 0x001c6258
Ghidra address:
PAL: 0x001cc0a0

Implements PowerbarMgr.


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