|
resonance 1.0.1
|
One participant's view of a session, driven by messages. More...
#include <gamer.h>


Public Member Functions | |
| Gamer (int nTrackCount, int nEndBar, GameStats *pStats) | |
| Build the participant's view for a level. | |
| virtual | ~Gamer () |
| Withdraw the queued command and delete both enable policies. | |
| void | Withdraw () |
| Withdraw every command queued under mCommand from the song clock. | |
| virtual void | DispatchPriv (Message *pMsg) |
| Receive one message. | |
| void | CreateEnableMgr (std::vector< ScoreTrackGraph * > *pGraphs) |
| Record the track graphs and build the enable policy for the session mode. | |
| void | SetBarOwner (int nTrack, int nBar, Player *pPlayer) |
| Record a player against one bar of one track. | |
| int | QueryBar (int nTrack, int nBar) |
| Ask whether one bar of one track may be caught. | |
| bool | IsFreestyleTrack (int nTrack) const |
| Report whether one track is outside catch mode. | |
| PhraseDatabase * | GetPhraseDatabase (int nTrack) |
| Report the phrase database of one track's graph. | |
| TrackData * | GetTrack (int nTrack) const |
| Report one track of the level. | |
| void | OnBar (int nBar) |
| Run the update of one bar and schedule the next. | |
| void | Start () |
| Schedule the first bar's update. | |
| void | SetBackGraphs (std::vector< BGTrackGraph * > *pGraphs) |
| Record the background tracks and build the enable policy for them. | |
| void | EnablePlayerFreestyle (int nStartBar, int nEndBar) |
| Give the first player a freestyle span. | |
| void | AddJuice (int nAmount) |
| Add juice to the first player and announce it. | |
| void | EndWithScore (int nScore) |
| End the game at the next bar, optionally with a score for the first player. | |
| void | AdvanceAt (Sch::Tick position) |
| Advance to the bar of a position, with PlayMap::ToggleLoop() of that bar as the advance. | |
| 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. | |
Public Attributes | |
| int | mJuiceFrozen |
| Non-zero while the per-bar juice charge is suspended. | |
| std::vector< MsgSource > | mTrackSources |
| One message source per track. | |
| EnableMgr * | mEnableMgr |
| Per-track enable policy. | |
| int | mCheated |
| Non-zero once a cheat ran during the game. | |
| Public Attributes inherited from MsgSource | |
| int | mGraphBuilt |
| A word no member of this class reads. | |
One participant's view of a session, driven by messages.
Gamer in the RTTI descriptor at 0x00901cb0, over MsgSink and MsgSource. Two vtables belong to it, one per base, both walked to their terminator: the primary at 0x007ce820 with delta 0, which is the MsgSink table because MsgSink is the first base, and the MsgSource table at 0x007ce7f8 with delta -4.
Both are four entries, so the class adds no virtual of its own. It overrides only DispatchPriv, inheriting MsgSink::Dispatch and both MsgSource virtuals unchanged.
The base subobjects account for +0x00 through +0x17. The destructor at 0x00110930 restores the primary table at +0x00 and the MsgSource one at +0x14, which is where MsgSource places its own vptr over its mSinks vector, so its subobject sits at +0x04 exactly as the -4 delta states. This class's own members start at +0x18.
The object is 0x9c bytes, which GrooveWorld allocates at 0x0018cfc0. The RTTI name of the unit's file-local command embeds the constructor's mangled name, which fixes its three parameter types as two integers and a GameStats pointer. The members are declared in recovered offset order.
| Gamer::Gamer | ( | int | nTrackCount, |
| int | nEndBar, | ||
| GameStats * | pStats ) |
Build the participant's view for a level.
Copies the world's players, gives every player a score of 0 with a ceiling of 100000 and, in kGameModeSolo, the configured juice and juice ceiling. A jukebox session starts in playback with every input binding off except the first slot's two rotations.
| nTrackCount | The level's track count. |
| nEndBar | The level's last bar, from LevelData::GetEndBar(). |
| pStats | The session statistics. |
|
virtual |
Withdraw the queued command and delete both enable policies.
| void Gamer::Withdraw | ( | ) |
Withdraw every command queued under mCommand from the song clock.
GrooveWorld calls it at 0x0018e6f0. The title is inferred.
|
virtual |
Receive one message.
Dispatches AdvanceSectionMsg, PhraseCapturedMsg, EnableFreestyleMsg, PlaybackModeMsg, and CrippleMsg to their handlers, in that order of test, and ignores every other message. The first two handlers are expanded inline here.
| pMsg | The message. |
Implements MsgSink.
| void Gamer::CreateEnableMgr | ( | std::vector< ScoreTrackGraph * > * | pGraphs | ) |
Record the track graphs and build the enable policy for the session mode.
In kPlayModeGame, kGameModeSolo builds GameEnableMgr::CreateReleasing() from configuration code 0x387 and the other modes GameEnableMgr::CreateUnrestricted(), and every track outside catch mode is then disabled. Outside kPlayModeGame, the solo and local modes build a LocalJamEnableMgr and the network mode a NetJamEnableMgr over eight owner buckets. The title is inferred.
| pGraphs | The track graphs, one per track. |
| void Gamer::SetBarOwner | ( | int | nTrack, |
| int | nBar, | ||
| Player * | pPlayer ) |
Record a player against one bar of one track.
Forwards to EnableMgr::SetBarOwner() on mEnableMgr. TrackData::SetOwner() is the recovered caller.
| nTrack | The track's index. |
| nBar | The bar. |
| pPlayer | The player. |
| int Gamer::QueryBar | ( | int | nTrack, |
| int | nBar ) |
Ask whether one bar of one track may be caught.
Forwards to EnableMgr::QueryBar() on mEnableMgr. TrackData::QueryBar() is the recovered caller, and Catcher treats a zero answer as a bar that cannot be caught.
| nTrack | The track's index. |
| nBar | The bar. |
| bool Gamer::IsFreestyleTrack | ( | int | nTrack | ) | const |
Report whether one track is outside catch mode.
| nTrack | The track's index. |
| PhraseDatabase * Gamer::GetPhraseDatabase | ( | int | nTrack | ) |
Report the phrase database of one track's graph.
| nTrack | The track's index into mGraphs. |
| TrackData * Gamer::GetTrack | ( | int | nTrack | ) | const |
Report one track of the level.
| nTrack | The track's index. |
| void Gamer::OnBar | ( | int | nBar | ) |
Run the update of one bar and schedule the next.
Switches each background track's MIDI by mBackEnableMgr, ends a solo or multiplayer game when its conditions are met, steps jam playback, ends a jukebox song at mEndBar, moves the streamed audio, and finally schedules bar nBar + 1. GamerCmd::Execute() is the caller. The title is inferred.
| nBar | The bar. |
| void Gamer::Start | ( | ) |
Schedule the first bar's update.
The title is inferred.
| void Gamer::SetBackGraphs | ( | std::vector< BGTrackGraph * > * | pGraphs | ) |
Record the background tracks and build the enable policy for them.
The policy is GameEnableMgr::CreateReleasing() over configuration code 0x386, one track per graph. RndWorld's draw pass is the caller. The title is inferred.
| pGraphs | The background tracks' graphs. |
| void Gamer::EnablePlayerFreestyle | ( | int | nStartBar, |
| int | nEndBar ) |
Give the first player a freestyle span.
Calls Fatal() with Only call Gamer::EnablePlayerFreestyle() from tutorial. outside the tutorial, which is what attests the title.
| nStartBar | The first bar, passed to Player::SetFreestyleSpan(). |
| nEndBar | The end bar, passed to Player::SetFreestyleSpan(). |
| void Gamer::AddJuice | ( | int | nAmount | ) |
Add juice to the first player and announce it.
The add_juice script command is the caller. The title is inferred.
| nAmount | The juice to add. |
| void Gamer::EndWithScore | ( | int | nScore | ) |
End the game at the next bar, optionally with a score for the first player.
Sets mEndBar to 0. A non-zero score becomes the first player's score with a ceiling of
| nScore | The score, or 0 to leave the score unchanged. |
| void Gamer::AdvanceAt | ( | Sch::Tick | position | ) |
Advance to the bar of a position, with PlayMap::ToggleLoop() of that bar as the advance.
Public because the advance-section script command calls it with no accessor in the image. The title is inferred.
| position | The position to advance to. |
| int Gamer::mJuiceFrozen |
Non-zero while the per-bar juice charge is suspended.
+0x1c
OnBar() charges juice only while it is zero. Public because the practice cheat and the freeze-juice script command write it through GrooveWorld::mGamer with no accessor in the image.
| std::vector<MsgSource> Gamer::mTrackSources |
One message source per track.
Public because GameEnableMgr sends InvalidateTrackMsg through an element directly at 0x00101ea0, and the image has no accessor. +0x78
| EnableMgr* Gamer::mEnableMgr |
Per-track enable policy.
+0x90
Public because the enable-all-tracks cheat drives it through GrooveWorld::mGamer with no accessor in the image.
| int Gamer::mCheated |
Non-zero once a cheat ran during the game.
+0x98
RecordSoloStats() copies it into GameStats::mCheated. Public because the practice, listen-mode, and enable-all-tracks cheats write it through GrooveWorld::mGamer with no accessor in the image.