|
resonance 1.0.1
|
Persisted result for one skill setting of one level. More...
#include <skillstats.h>
Public Member Functions | |
| SkillStats () | |
| Construct a record with no defined contents. | |
| virtual | ~SkillStats () |
| virtual void | Save (OBStream &stream) |
| Write this record. | |
| virtual void | Load (IBStream &stream) |
| Read this record. | |
| void | Clear () |
| Zero both members, the high score first. | |
Public Attributes | |
| int | mBeaten |
| Non-zero once the level is beaten at this difficulty. | |
| int | mHighScore |
| The best score at this difficulty. | |
Persisted result for one skill setting of one level.
Its RTTI descriptor is at 0x007d3db8. It has no base. The compiler places the vptr after the data at +0x08, and the class is 0x0c bytes. Its vtable is at 0x007d3d20 and runs the type function, the destructor, Save(), and Load().
LevelStats stores exactly three of these and Save() at 0x00142760 writes all three without a loop, so the count is fixed in the source rather than computed.
Save() emits the beaten flag as a single truth byte and the high score as a 16-bit halfword, and the version 1 branch of Load() reads the high score as a full word, so the narrowing arrived with record version 2.
Both members are public, because CampaignStats reads and writes them directly and the image has no accessor for either.
The assignment at 0x001453e0 copies the two members and not the vptr. It is the implicit one and is not written. LevelStats::Assign() uses it.
|
inline |
Construct a record with no defined contents.
Defined in the header rather than compiled out of line. Every construction in the image stores only the vtable pointer, which is what establishes both that the constructor exists and that it initialises neither member. LevelStats::Load() relies on that: it builds three of these on the stack and hands each straight to Load().
|
virtual |
|
virtual |
Write this record.
Vtable slot 2. The version byte 2 precedes the payload, and it is written whether or not the reader will consult it, because Load() branches on the version CampaignStats::Load() stored in g_nStatsRecordVersion rather than on this byte.
| stream | The stream to write to. |
|
virtual |
Read this record.
Vtable slot 3. The branch is on g_nStatsRecordVersion, which CampaignStats::Load() fills before it arrives at any element. A version other than 1 or 2 reads nothing, and both members retain their previous values.
| stream | The stream to read from. |
| void SkillStats::Clear | ( | ) |
Zero both members, the high score first.
LevelStats::Reset() runs it on each of the three records it appends, after the inline constructor has stored only the vtable pointer. The title is inferred.
| int SkillStats::mBeaten |
Non-zero once the level is beaten at this difficulty.
CampaignStats::RecordLevelBeaten() sets it. +0x00
| int SkillStats::mHighScore |
The best score at this difficulty.
CampaignStats::RecordHighScore() raises it. +0x04