|
resonance 1.0.1
|
Player driven by a remote machine. More...
#include <netplayer.h>


Public Member Functions | |
| NetPlayer (int nId, int nTrack, const HxStr &name, const FreqAppearance *pAppearance) | |
| Construct a player that a remote machine drives. | |
| virtual | ~NetPlayer () |
| virtual int | GetTrack () |
| Report the track the last selection chose. | |
| virtual int | GetPlace () |
| Report the place the last selection chose. | |
| virtual void | DispatchPriv (Message *message) |
| Receive one message. | |
| Public Member Functions inherited from Player | |
| Player (int nId, const HxStr &colorName, const FreqAppearance *pAppearance) | |
| Register the player under its identifier and start its tallies. | |
| virtual | ~Player () |
| virtual int | GetInputSlot () const |
| Report the controller slot that drives this player. | |
| virtual int | IsNull () |
| Test whether this player is the stand-in for an absent one. | |
| virtual int | UnusedQuery () |
| Report zero. | |
| virtual void | UnusedHook () |
| Do nothing. | |
| virtual void | SetFreestyleSpan (int nStartBar, int nEndBar) |
| Give the player a span of bars it plays freely. | |
| virtual int | IsFreestyleBar (int nBar) |
| Test whether a bar lies in the player's freestyle span. | |
| virtual int | IsLooping () |
| Report whether the player is looping. | |
| virtual void | AnnounceState () |
| Announce the player's state. | |
| virtual void | DeactivatePlacer () |
| Deactivate the powerup placer. | |
| virtual void | Print (std::ostream &stream) |
| Write a description of this player to stream. | |
| virtual int | CountCaughtGem () |
| Count one caught gem. | |
| virtual int | CountMissedGem () |
| Count one missed gem. | |
| virtual int | GetMultiplier (int nBar) |
| Report the score multiplier a capture starting at a bar earns. | |
| virtual int | GetBestStreak () |
| Report the best streak of consecutive captures. | |
| virtual float | GetCaptureRatio () |
| Report the proportion of captured phrases among those captured and muffed. | |
| virtual int | GetGameMode () |
| Report the game mode the player was built in. | |
| virtual int | MarkBarScored (int nBar) |
| Record that a bar scored, reporting whether it had not scored before. | |
| int | GetJuice () |
| Report the juice the player has banked. | |
| int | GetScore () |
| Report the player's score. | |
| void | SetScore (int nScore, int nMaxScore) |
| Set the score and the ceiling it is clamped to. | |
| void | SetJuice (int nJuice, int nMaxJuice) |
| Set the juice and the ceiling it is clamped to. | |
| void | AddJuice (int nAmount, int bNotify) |
| Add juice, clamped to 0 through the ceiling, and announce a change. | |
| void | AddScore (int nDelta, int bNotify) |
| Add to the score, clamped to 0 through the ceiling, and announce a change. | |
| void | OnMsg (const PhraseCapturedMsg &msg) |
| Add a captured phrase's score and juice, announcing both. | |
| int | IsLocal () const |
| Report whether the player has an input slot. | |
| HxStr | GetColorName () |
| Copy the player's colour name. | |
| HxStr | GetUsername () |
| Copy the username of the player's appearance. | |
| int | StartMF () |
| Run AnnounceState() and report zero. | |
| int | StopMF () |
| Run DeactivatePlacer() and report zero. | |
| Public Member Functions inherited from IDable< Player > | |
| IDable (int nId) | |
| Register the object in sObjects under an identifier. | |
| virtual | ~IDable () |
| Release the table slot this object occupies. | |
| Public Member Functions inherited from IDableBase | |
| virtual | ~IDableBase () |
| Public Member Functions inherited from MsgSink | |
| void * | operator new (size_t nSize) |
| Allocate a sink from the tagged heap under the tag "MsgSink". | |
| void | operator delete (void *pBlock) |
| Release a sink to the tagged heap. | |
| virtual | ~MsgSink () |
| virtual void | Dispatch (Message *pMsg) |
| Accept a message. | |
| 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 | |
| Static Public Member Functions inherited from Player | |
| static void | Delete (Player *pPlayer) |
| Delete a player through its virtual destructor, doing nothing for null. | |
| Public Attributes inherited from Player | |
| int | mPlayerId |
| Identifier a message addresses this player by. | |
| HxStr | mColorName |
| The player's colour name, such as green or red. | |
| long long | mLastEraseTime |
| Scheduler time of this player's last erase press, in nanoseconds. | |
| Public Attributes inherited from MsgSource | |
| int | mGraphBuilt |
| A word no member of this class reads. | |
| Static Public Attributes inherited from IDable< Player > | |
| static std::vector< Player * > | sObjects |
| Every registered object, indexed by mId. | |
| Protected Attributes inherited from Player | |
| int | mMaxJuice |
| int | mMaxScore |
| Protected Attributes inherited from IDableBase | |
| int | mId |
Player driven by a remote machine.
NetPlayer in the RTTI descriptor at 0x008eef18, with Player as its only base. Its three vtables are at 0x007d0ab0, 0x007d0a88, and 0x007d0a60, each walked to its terminator.
The primary table has 21 entries, the same as the base, so this class adds no virtual and only replaces. It replaces exactly two of the base's slots, 4 and 5, where the base returns -1 and 0, and it replaces DispatchPriv in its MsgSink table. It inherits both MsgSource virtuals and every other primary slot, which makes it a thin specialisation rather than a parallel implementation.
Two members are recovered, the track and place slots 4 and 5 return, where the base returns -1 and 0 instead. The bytes from +0x2c to +0x47 are unrecovered. Its destructor restores the base tables and releases the pointer the base declares at +0x28. That work is the inlined base destructor, and the destructor body is empty.
| NetPlayer::NetPlayer | ( | int | nId, |
| int | nTrack, | ||
| const HxStr & | name, | ||
| const FreqAppearance * | pAppearance ) |
Construct a player that a remote machine drives.
Runs Player's constructor with nId, name, and pAppearance, then stores nTrack in mTrack and clears mPlace. GrooveWorld::AddNetPlayer() is the recovered caller, and it passes its own identifier as both nId and nTrack.
| nId | The player's identifier. |
| nTrack | The track GetTrack() reports until a message replaces it. |
| name | The player's name. |
| pAppearance | The appearance the player is drawn with. |
|
virtual |
|
virtual |
Report the track the last selection chose.
The base implementation returns -1 instead.
Reimplemented from Player.
|
virtual |
Report the place the last selection chose.
The base implementation returns zero instead.
Reimplemented from Player.
|
virtual |
Receive one message.
Dispatches on Message::Type() against two identities, TrackSelectPacket and TrackSelectMsg, so one handler covers track selection arriving locally and over the network. A packet goes to OnTrackSelectPacket(). A TrackSelectMsg whose +0x10 names this player updates the two cached words, and anything else falls through to the base.
| message | The message. |
Reimplemented from Player.