|
resonance 1.0.1
|
Powerup placer that walks a bar cursor forward with the song and deploys at the bar it rests on. More...
#include <gamepowerupplacer.h>


Public Member Functions | |
| GamePowerupPlacer (LocalPlayer *pOwner, Application *pApplication, PowerupCollectionI *pCollection) | |
| Post a task against the song clock and start with the cursor off the map. | |
| virtual | ~GamePowerupPlacer () |
| virtual void | MoveCursor (int nStep) |
| Move the cursor by the negation of the argument and announce where it rests. | |
| virtual void | AnnounceCursor () |
| Announce where the cursor rests, for a listener that has just registered. | |
| virtual void | DeployPowerup () |
| Deploy the selected powerup at the bar the cursor rests on, then take the cursor off the map. | |
| virtual void | Activate () |
| Schedule the task on the clock, on the PowerupPlacer side. | |
| virtual void | Deactivate () |
| Withdraw the task from the clock, on the PowerupPlacer side. | |
| virtual int | Tick (int nElapsedTicks) |
| Advance the cursor to the current bar and announce it. | |
| Public Member Functions inherited from PowerupPlacer | |
| PowerupPlacer () | |
| virtual | ~PowerupPlacer () |
| 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. | |
| Public Member Functions inherited from TickTask | |
| TickTask (Sch::TickClock *pClock, int nPeriod, int bAligned) | |
| virtual | ~TickTask () |
| Withdraw the queued command. | |
| virtual void | Print (std::ostream &stream) |
| Write the task to a diagnostic stream. | |
| void | Start (int nEpochOffset) |
| Post the task on its clock. | |
| void | Run () |
| Run Tick() for the run now due and post the next one. | |
| void | Stop () |
| Withdraw the queued command and forget its handle. | |
| Public Member Functions inherited from Attachment | |
| Attachment () | |
| virtual | ~Attachment () |
| int | Release () |
| Give back one reference and destroy the object once the last one is gone. | |
| virtual void | Destroy () |
| Destroy the object. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from Attachment | |
| static void | ReleaseIfSet (Attachment *pAttachment) |
| Give back one reference to an object that may be null. | |
| Public Attributes inherited from MsgSource | |
| int | mGraphBuilt |
| A word no member of this class reads. | |
| Public Attributes inherited from Attachment | |
| int | mRefs |
Powerup placer that walks a bar cursor forward with the song and deploys at the bar it rests on.
Its RTTI descriptor is at 0x008f0130. It is built over two bases, PowerupPlacer at offset 0 and TickTask at offset 20. It is the one class in this family with two bases, and it therefore has two tables. The primary table at 0x007e4c50 has nine entries, the same length as PowerupPlacer's, so the class adds no virtual on that side. The secondary table at 0x007e4c20 has five entries with a slot 0 delta of -20 and serves the TickTask subobject.
The object is 0x44 bytes. PowerupPlacer and its MsgSource base occupy +0x00 through +0x13 with the primary vptr at +0x10. The TickTask subobject occupies +0x14 through +0x33 with its reference count at +0x14 and its own vptr at +0x18. The four members below follow it.
Nothing in the image constructs one. The constructor at 0x001ccb70 has no reference of any kind, from code or from data, so the class is unreachable in the shipped game. Its two PowerupPlacer siblings, JamPowerupPlacer and SimplifiedGamePowerupPlacer, are both constructed and share the deployment shape below.
Slots 6 and 8 take the cursor off the map with a DisplayPointerMsg that sets only the player value (-1, which Print() reports as remove) and the player, leaving the bar unset.
| GamePowerupPlacer::GamePowerupPlacer | ( | LocalPlayer * | pOwner, |
| Application * | pApplication, | ||
| PowerupCollectionI * | pCollection ) |
Post a task against the song clock and start with the cursor off the map.
The TickTask subobject runs against the application's song clock with a period of 480 ticks and is not aligned.
| pOwner | The player whose placer this is. |
| pApplication | The application the song clock is reached through. |
| pCollection | The store the deployment draws from. |
|
virtual |
|
virtual |
Move the cursor by the negation of the argument and announce where it rests.
A zero argument does nothing. Otherwise the routine negates the argument, reads the current bar from the song clock, and reads Player::GetTrack() for the message. A cursor of -1 accepts a step of 1 only, and then only when PowerupCollectionI::HasSelection() reports a selection, and the cursor jumps to the current bar. A cursor already on the map moves by the step. A cursor that falls behind the current bar leaves the map with a remove message, one more than four bars ahead of it steps back one bar without a message, and any other position is announced with a DisplayPointerMsg.
| nStep | The step, which the body negates. |
Reimplemented from PowerupPlacer.
|
virtual |
Announce where the cursor rests, for a listener that has just registered.
A cursor of -1 sends nothing.
Reimplemented from PowerupPlacer.
|
virtual |
Deploy the selected powerup at the bar the cursor rests on, then take the cursor off the map.
A cursor of -1 returns. The cursor must also lie before the bar PlayMap::GetEndBar() of Globals::GetPlayMap() reports. The deployment dispatches PowerupCollectionI::Deploy() with Player::GetTrack() and the cursor bar, then sends a remove DisplayPointerMsg and sets the cursor to -1.
Reimplemented from PowerupPlacer.
|
virtual |
Schedule the task on the clock, on the PowerupPlacer side.
The routine starts the TickTask subobject with the epoch offset kTickInfinity.
Reimplemented from PowerupPlacer.
|
virtual |
Withdraw the task from the clock, on the PowerupPlacer side.
The routine stops the TickTask subobject, which cancels the queued command and resets the handle to -2.
Reimplemented from PowerupPlacer.
|
virtual |
Advance the cursor to the current bar and announce it.
Slot 4 of the TickTask table. The elapsed count arrives already saturated against Sch::Tick's bounds, and this body adds 480 and saturates again before dividing by 1920, so the bar it computes is half a beat ahead of the run now due. A cursor of -1 or a cursor already at or past the computed bar produces no message. The return value is 1 on every path, so the task runs again every 480 ticks for as long as it is scheduled.
| nElapsedTicks | Ticks between the task's epoch and the run now due. |
Implements TickTask.