|
resonance 1.0.1
|
Settings a game session is started with. More...
#include <gameparams.h>

Public Member Functions | |
| GameParams () | |
| Start with every member clear. | |
| GameParams (const GameParams &other)=default | |
| Copy every member in declaration order. | |
| virtual | ~GameParams () |
| Release the three strings. | |
| virtual void | Save (OBStream *pStream) const |
| Write the settings to a stream. | |
| virtual void | Load (IBStream *pStream) |
| Read the settings back from a stream. | |
| GameParams & | operator= (const GameParams &other) |
| Copy every member except mUnsavedString from another instance. | |
| bool | operator== (const GameParams &other) const |
| Compare every member except mUnsavedString with another instance, the set operator=() copies. | |
| void | Print (std::ostream &stream) const |
| Write the settings to a diagnostic stream on one line, ending it with a newline. | |
Public Attributes | |
| HxStr | mLevelName |
| The level the session plays. | |
| HxStr | mArenaName |
| The arena the session plays in. | |
| int | mPlayMode |
| int | mDifficulty |
| int | mNetGame |
| Written by GameManagerImpl::SetGameMode() as the test for net, 0 or 1, and labelled netgame= by Print(). | |
| int | mLoadingGame |
| Set while a saved game is loading, labelled loadinggame= by Print(). | |
| int | mJukeboxMode |
| Set for a jukebox session. | |
Settings a game session is started with.
Its RTTI descriptor is at 0x0086f628. It has no base. The compiler places the vptr after the data at +0x34, and the class is 0x38 bytes. Its vtable at 0x007db5a0 has four entries and a zero terminator at index 4. The destructor and the two transfer members are the whole set of virtuals.
The layout comes from the constructor, the destructor, and the copy constructor together. The constructor zeroes every word from +0x00 to +0x30 in ascending order, the destructor releases the buffers at +0x18, +0x0c, and +0x04 in reverse declaration order, and the copy constructor at 0x001fc480 copies all ten members in declaration order. The GameManagerImpl destructor corroborates the three strings independently by releasing their buffers at +0x6c, +0x74, and +0x80 of a manager whose settings start at +0x68.
That copy constructor is the compiler-generated one and is therefore not declared here. Two measurements agree. It copies every member in exact declaration order with no logic of its own, and it sits at 0x001fc480 while every hand-written member of the class sits in the 0x00187xxx run, which places it in the translation unit that copies a GameParams rather than in the one that defines the class.
The purpose of most members is not recovered. Three of the ten are public because GameManagerImpl reads and writes them directly with no accessor in the image, and the two names are public because Renderer::LoadLevel() reads them directly, as is the jukebox flag, which Globals::IsJukeboxMode() reads, and the loading flag, which MetStageFinishScreen reads. A friend declaration on this class would fit the image equally well as the promotion. The other three have no traced reader and stay private.
mUnsavedString is the one member that neither Save(), Load(), nor operator=() touches, and the compiler-generated copy constructor is the only routine in the image that copies it.
This class is declared because several network packets embed one.
| GameParams::GameParams | ( | ) |
Start with every member clear.
|
default |
Copy every member in declaration order.
Defaulted rather than written, because the routine at 0x001fc480 is the compiler-generated copy constructor, as the class documentation records. Declaring it is what the destructor and the assignment operator below make necessary: a user-declared destructor deprecates an implicit copy constructor, and the three packets that embed a GameParams copy one.
|
virtual |
Release the three strings.
The declaration is first among the class's virtuals, which is what places it at vtable slot 1. The body is empty, and the three releases are the compiler-generated member destructor calls. The GameManagerImpl destructor inlines the whole sequence.
|
virtual |
Write the settings to a stream.
Slot 2. GameManagerImpl::Save() runs it after writing its own three words.
| pStream | The stream to write to. |
|
virtual |
Read the settings back from a stream.
Slot 3. GameManagerImpl::Load() runs it after reading its own three words. The fields come back in the order Save() wrote them.
| pStream | The stream to read from. |
| GameParams & GameParams::operator= | ( | const GameParams & | other | ) |
Copy every member except mUnsavedString from another instance.
Self-assignment is not tested, and the routine returns this instance.
| other | The settings to copy. |
| bool GameParams::operator== | ( | const GameParams & | other | ) | const |
Compare every member except mUnsavedString with another instance, the set operator=() copies.
The level name and the arena are compared as strings and the other seven words as integers, in declaration order, stopping at the first difference. The shipped program does not call it, and the title is inferred from the shape.
| other | The settings to compare with. |
| void GameParams::Print | ( | std::ostream & | stream | ) | const |
Write the settings to a diagnostic stream on one line, ending it with a newline.
Not virtual. The labels are GameParams:, level=, arena=, friends=, then game or jam for a play mode of 1 or anything else, difficulty=, constrain-jam when mConstrainJam is set, and then netgame=, loadinggame=, and jukeboxmode=, each of the last three written with no separating space. SPJoinAcceptPacket, BSLoadLevelPacket, and SCLoadLevelPacket call it from their own Print().
| stream | The stream to write to. |
| HxStr GameParams::mLevelName |
The level the session plays.
+0x00
Public because Renderer::LoadLevel() copies it directly to build the level's load path, and the image has no accessor for it.
| HxStr GameParams::mArenaName |
The arena the session plays in.
+0x08
Public on the same evidence as mLevelName.
| int GameParams::mPlayMode |
Driven by GameManagerImpl slots 29 and 31, the play mode. +0x1c
| int GameParams::mDifficulty |
Driven by GameManagerImpl slots 28 and 30, the difficulty. +0x20
| int GameParams::mNetGame |
Written by GameManagerImpl::SetGameMode() as the test for net, 0 or 1, and labelled netgame= by Print().
+0x28
| int GameParams::mLoadingGame |
Set while a saved game is loading, labelled loadinggame= by Print().
+0x2c
Public because MetStageFinishScreen::EnterAndShow() reads it directly, and the image has no GameParams accessor for it.
| int GameParams::mJukeboxMode |
Set for a jukebox session.
+0x30
Overlay's constructor shows Jukebox Mode while it is set, and HudFreq hides its icon. Public because Globals::IsJukeboxMode() reads it directly, and the image has no GameParams accessor for it.