|
resonance 1.0.1
|
Store of one powerup of every configured kind, with a count for each. More...
#include <powerupcollection.h>


Classes | |
| class | PowCount |
| One configured kind, with the number of them stored. More... | |
Public Member Functions | |
| PowerupCollection (LocalPlayer *pOwner, int bUnlimited) | |
| Build one entry for every kind the configuration lists. | |
| virtual | ~PowerupCollection () |
| Delete every stored powerup. | |
| virtual void | Add (PowerupType type) |
| Increase the count of the entry whose kind matches, up to nine. | |
| virtual void | SelectRelative (int nDelta) |
| Move the selection by nDelta, wrapping, and stop at the first entry with a count above zero. | |
| virtual void | Select (int nIndex) |
| Select one entry by index, without checking its count. | |
| virtual void | Deploy (int nTrack, int nBar) |
| Deploy the selected powerup and spend one of them. | |
| virtual int | HasSelection () const |
| Report whether an entry is selected. | |
| virtual void | SendState () const |
| Send one PowerupCountMsg for every non-empty entry, then one ChoosePowerupMsg. | |
| 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. | |
Store of one powerup of every configured kind, with a count for each.
Its RTTI descriptor is at 0x008ef460. It has PowerupCollectionI as its one base at offset 0. Its table is at 0x007e48a8 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 all six of the slots the base introduces.
The object is 0x2c bytes. The base occupies the first 0x14 including the inherited vptr at +0x10, and the four members below follow it.
LocalPlayer's constructor allocates one at 0x0011e0ec for one of its modes and stores the pointer at its own +0xa4, then hands the same pointer to the JamPowerupPlacer it allocates next. Its other modes allocate a SinglePowerupCollection instead.
The class manages every powerup it stores. The destructor deletes each one through the Powerup table and then releases the vector.
Every method name is inferred from the bodies. No method name survives anywhere in the image.
| PowerupCollection::PowerupCollection | ( | LocalPlayer * | pOwner, |
| int | bUnlimited ) |
Build one entry for every kind the configuration lists.
The kinds come from configuration code 0x389 through QueryConfigVector(), and each one is turned into a powerup by Powerup::CreateForType(). Every entry starts with a count of zero, unless bUnlimited is set, in which case each entry starts with one and the selection starts at the first entry.
| pOwner | The player whose collection this is. |
| bUnlimited | Non-zero to start every entry stocked and to stop Deploy() from spending. |
|
virtual |
Delete every stored powerup.
|
virtual |
Increase the count of the entry whose kind matches, up to nine.
An entry already storing nine is ignored, and a kind with no entry is ignored. A successful increase sends a PowerupCountMsg. With nothing selected, SelectRelative(1) follows.
| type | The kind. |
Reimplemented from PowerupCollectionI.
|
virtual |
Move the selection by nDelta, wrapping, and stop at the first entry with a count above zero.
A delta of zero returns with no change and no message. The search tries every entry once and selects -1 when all of them are empty. Either outcome sends a ChoosePowerupMsg.
| nDelta | The step to apply to the selected index. |
Reimplemented from PowerupCollectionI.
|
virtual |
Select one entry by index, without checking its count.
An index outside the vector is not tested for.
| nIndex | The entry, or -1 for none. |
Reimplemented from PowerupCollectionI.
|
virtual |
Deploy the selected powerup and spend one of them.
The selected entry is read with no test against -1, so a caller selects first. A powerup that reports failure stops the whole body. With mUnlimited set the count is preserved and no message follows. Otherwise the count drops by one, a PowerupCountMsg follows, and an entry that reaches zero triggers SelectRelative(1).
| nTrack | Forwarded to Powerup::Deploy(). See PowerupCollectionI::Deploy(). |
| nBar | Forwarded to Powerup::Deploy(). See PowerupCollectionI::Deploy(). |
Reimplemented from PowerupCollectionI.
|
virtual |
Report whether an entry is selected.
Reimplemented from PowerupCollectionI.
|
virtual |
Send one PowerupCountMsg for every non-empty entry, then one ChoosePowerupMsg.
Reimplemented from PowerupCollectionI.