|
resonance 1.0.1
|
Saved record of one player persona. More...
#include <metpersonadata.h>

Public Member Functions | |
| void * | operator new (size_t nSize) |
| Allocate an instance from the tagged heap. | |
| void | operator delete (void *pBlock) |
| Release an instance to the tagged heap. | |
| MetPersonaData () | |
| Construct an empty record. | |
| virtual | ~MetPersonaData () |
| MetPersonaData & | operator= (const MetPersonaData &other) |
| Copy every member from another record. | |
| virtual void | Save (OBStream *pStream) |
| Write the record to a stream. | |
| virtual void | Load (IBStream *pStream) |
| Read the record back from a stream. | |
| void | UpdateSkillStatus () |
| Record in the appearance the highest skill the campaign has reached. | |
| void | AttachToBurnSlot (int nSlot) |
| Hang this persona's avatar in one of the four persona burn slots. | |
| int | GetSkillStatus () |
| Report the skill status recorded in the appearance. | |
| void | SetName (const HxStr &name) |
| Replace the username in the embedded appearance. | |
| void | Print (std::ostream &stream) |
| Write the record to a diagnostic stream. | |
Static Public Member Functions | |
| static std::vector< MetPersonaData * > * | loadList () |
| Resolve the list of records the memory-card path last read. | |
| static std::vector< MetPersonaData * > * | savedList () |
| Resolve the list of records the player has saved. | |
| static std::vector< MetPersonaData * > & | LoadListStorage () |
| Hold the list loadList() reports. | |
| static std::vector< MetPersonaData * > & | SavedListStorage () |
| Hold the list savedList() reports. | |
| static void | ClearLoadList () |
| Delete every record in loadList() and empty it. | |
| static void | ClearSavedList () |
| Delete every record in savedList() and empty it. | |
| static void | CopyList (std::vector< MetPersonaData * > *pDestination, const std::vector< MetPersonaData * > *pSource) |
| Replace one list with fresh copies of the records in another. | |
Public Attributes | |
| CampaignStats | mStats |
| Campaign progress of this persona. | |
| FreqAppearance | mAppearance |
| Appearance the front end displays and edits. | |
| HxStr | mBirthday |
| int | mIsPrefab |
| Set to 1 by MetFreqLoader's parser on every pre-fab persona it reads. | |
| HxStr | mSavedName |
Saved record of one player persona.
Its RTTI descriptor is at 0x0086f610. It is a leaf class with no base. Following the g++ 2.x layout for a class with no base, the vptr sits after the data members, here at +0x168, and the object is 0x16c bytes. The four-entry vtable is at 0x00804bd8.
The class supplies both its own allocation and its own release function, and both tag the block with the literal MetPersonaData at 0x00804a78.
Two of its members are objects with virtuals. The member at offset 0 is a CampaignStats, 0x140 bytes with its vptr at +0x13c, built by CampaignStats::CampaignStats() at 0x00140580 and torn down by its destructor at 0x00140768. The member at +0x140 is a FreqAppearance, 0x14 bytes with its vptr at +0x10, built at 0x001745b8 and torn down by the destructor its vtable slot 1 records at 0x00174730.
Vtable slots 2 and 3, at 0x0032b880 and 0x0032b968, are a matched pair. Slot 2 hands the constant 4-byte value 2 to its argument through the argument's vtable slot 4 and then forwards the same argument to slot 2 of both member objects. Slot 3 takes a 4-byte value back through slot 6 and forwards to slot 3 of both members. The pair is therefore the persist-and-restore pair with a record version of 2.
The two slot numbers identify the argument's class. Slot 4 of OBStream is Write(const void *, int) and slot 6 of IBStream is Read(void *, int). GameManagerImpl calls both slots on both stream classes from its persist-and-restore pair.
| MetPersonaData::MetPersonaData | ( | ) |
Construct an empty record.
The campaign's level list is rebuilt from the configuration, the birthday starts as 0/0/00, 12:00, and the pre-fab flag is clear.
|
virtual |
| void * MetPersonaData::operator new | ( | size_t | nSize | ) |
Allocate an instance from the tagged heap.
| nSize | The object size, which the compiler supplies. |
| void MetPersonaData::operator delete | ( | void * | pBlock | ) |
Release an instance to the tagged heap.
| pBlock | The block. |
|
inlinestatic |
Resolve the list of records the memory-card path last read.
The list is a function-local static vector at 0x00891ab8 behind the guard flag at 0x00699d78, in LoadListStorage(). ClearLoadList() empties it and eight front-end screens read it, among them MetExpansionPakScreen, MetLoadFreqScreen, MetMemCardLoadScreen, MetPersonaSaverScreen, and MetLocPickCharScreen. The address recorded here is the single out-of-line emission of the inline accessor those eight share.
It is a static member rather than a free function, because it takes no receiver and vends exactly one class. The owning class is an inference from the element type alone, since no descriptor, literal, or file path in the image attributes either address.
|
inlinestatic |
Resolve the list of records the player has saved.
The list is a function-local static vector at 0x00891aa8 behind the guard flag at 0x00699d74, in SavedListStorage(). MetPersonaSaverScreen appends a copy of a newly saved record that is not a team identity, and MetLoadPreFabScreen, MetLocPickCharScreen, and MetExpansionPakScreen read it. The title is inferred from the saver's use. The address recorded here is the single out-of-line emission of the inline accessor those callers share.
|
static |
Hold the list loadList() reports.
The first call constructs the vector and registers its destructor at 0x00218098 through atexit.
|
static |
Hold the list savedList() reports.
The first call constructs the vector and registers its destructor at 0x00217ff8 through atexit.
|
static |
Delete every record in loadList() and empty it.
MetRenderer's constructor, MetLocPickCharScreen, MetMemDetectScreen, and MetPersonaSaverScreen call it. The list is resolved afresh for every read.
|
static |
Delete every record in savedList() and empty it.
MetRenderer's constructor is the one caller.
|
static |
Replace one list with fresh copies of the records in another.
Every record in the destination is deleted first. MetLocPickCharScreen's slot 19 is the one caller.
| pDestination | The list to replace. |
| pSource | The records to copy. |
| MetPersonaData & MetPersonaData::operator= | ( | const MetPersonaData & | other | ) |
Copy every member from another record.
GameManagerImpl::AddPersona() is the one recovered caller. It default-constructs a heap record and then runs this, rather than using a copy constructor, which is what establishes the member as an assignment. The result is discarded there, so the return type is the conventional one rather than a recovered one.
| other | The record to copy. |
|
virtual |
Write the record to a stream.
Slot 2. The record version 2 goes out first, then both member objects write themselves through their own slot 2.
The stream class was recorded as unidentified when this class first landed. It is OBStream, which the slot the routine calls settles. Slot 4 of OBStream is Write(const void *, int), and GameManagerImpl::Save() calls the same slot on the same class.
| pStream | The stream to write to. |
|
virtual |
Read the record back from a stream.
Slot 3. The counterpart of Save(), reaching slot 6 of IBStream, which is Read(void *, int). mSavedName takes the username just read. A record of version 0 or below then has a button list, a GameOptions record, and a list of numbered strings, all read and discarded, and a record of version 2 or above has the birthday. The skill status is recomputed last through UpdateSkillStatus(), expanded in place.
| pStream | The stream to read from. |
| void MetPersonaData::UpdateSkillStatus | ( | ) |
Record in the appearance the highest skill the campaign has reached.
The status is 4 when stage 5 is complete on expert and the secret stage is unlocked, 3 when only that stage is complete, 2 when stage 4 is complete on normal, 1 when stage 3 is complete on easy, and 0 otherwise. MetStageFinishScreen slot 5 is the caller.
| void MetPersonaData::AttachToBurnSlot | ( | int | nSlot | ) |
Hang this persona's avatar in one of the four persona burn slots.
Forwards to FreqAppearance::AttachToBurnSlot() on the embedded appearance. MetTutorialScreen::OnExitFinished() is a caller.
| nSlot | The burn slot, 0 through 3. |
| int MetPersonaData::GetSkillStatus | ( | ) |
Report the skill status recorded in the appearance.
Forwards to FreqAppearance::GetSkillStatus() on the embedded appearance. The image has no caller.
| void MetPersonaData::SetName | ( | const HxStr & | name | ) |
Replace the username in the embedded appearance.
The image has no caller, so this is the out-of-line copy of an inline member. The name is inferred.
| name | The new username. |
| void MetPersonaData::Print | ( | std::ostream & | stream | ) |
Write the record to a diagnostic stream.
The campaign levels, the appearance, the birthday, and the pre-fab flag follow the labels CampaignStats=, FreqAppearance=, Birthday=, and IsPrefab=. The image has no caller.
| stream | The stream to write to. |
| CampaignStats MetPersonaData::mStats |
Campaign progress of this persona.
+0x00
Public because MetStageFinishScreen slot 5 records and queries the finished stage through it directly, and the image has no accessor. The member sits at offset 0, which is why callers pass the persona where a CampaignStats is expected.
| FreqAppearance MetPersonaData::mAppearance |
Appearance the front end displays and edits.
Public rather than private, because MetLoadFreqBaseScreen::UpdateNameLabel() reads the username out of it directly and the image has no accessor to route that read through. A friend declaration fits the image equally well. +0x140
| HxStr MetPersonaData::mBirthday |
| int MetPersonaData::mIsPrefab |
Set to 1 by MetFreqLoader's parser on every pre-fab persona it reads.
+0x15c
Public because that parser writes it directly, and the image has no accessor.
| HxStr MetPersonaData::mSavedName |