|
resonance 1.0.1
|
A player's identity and settings. More...
#include <playerinfo.h>
Public Member Functions | |
| PlayerInfo () | |
| Construct an empty identity. | |
| PlayerInfo (unsigned nPlayerId, const HxStr &colorName, const FreqAppearance &appearance, int nTrack) | |
| Construct an identity from its parts. | |
| virtual | ~PlayerInfo () |
| Release the vector, the appearance, and the name. | |
| virtual void | Print (std::ostream &stream) const |
| Write the identity to a diagnostic stream. | |
| virtual void | Save (OBStream &stream) const |
| Write the identity to a stream. | |
| virtual void | Load (IBStream &stream) |
| Read the identity back from a stream. | |
A player's identity and settings.
Its RTTI descriptor is at 0x0086f738. It has no base. The compiler places the vptr after the data at +0x3c, and the class is 0x40 bytes. Its vtable at 0x007d2820 has five entries and a zero terminator at index 5, the type function, the destructor, and the three members below.
The layout comes from the copy constructor at 0x0010baa0 and the destructor together. The copy constructor copies every member in order, and the destructor releases the vector, the appearance, and the string buffer in reverse declaration order. The vector at +0x30 is deep-copied through the allocator and a memmove, which is what establishes that the class owns its elements. The element type is not recovered, and int stands in for it. Every member is private, because the only readers outside the class are the three members below.
That copy constructor is the compiler-generated one and is therefore not declared here. It copies all eight members in exact declaration order with no logic of its own, and it sits at 0x0010baa0 while every hand-written member of the class sits in the 0x00133xxx and 0x00135xxx runs, which places it in a different translation unit.
mOriginalId is the one member that none of Print(), Save(), or Load() touches. Only the four-argument constructor writes it.
Two network packets embed one of these, SCPlayerJoinedPacket and ToAllNetManagersPacket. The image has no caller of the four-argument constructor. Every name below past the identifier, colour, and appearance is inferred from its type and its initial value alone. The first three follow the parameter order of Player's constructor and the plid and clr labels the join packets print.
|
inline |
Construct an empty identity.
Only the name, the appearance, and the vector are initialised. The integer members are left as the storage holds them.
Inline. The address is its uncalled out-of-line copy.
|
inline |
Construct an identity from its parts.
mActive starts at 1 and mReady at 0, and mOriginalId receives the same value as mPlayerId.
Inline. The address is its uncalled out-of-line copy.
| nPlayerId | The identifier stored in mPlayerId and mOriginalId. |
| colorName | The colour name stored in mColorName. |
| appearance | The appearance to copy. |
| nTrack | The value stored in mTrack. |
|
virtual |
Release the vector, the appearance, and the name.
|
virtual |
Write the identity to a diagnostic stream.
Slot 2. The output opens with the literal {AppPlayerInfo: , which is the one place in the image that writes a name for this class outside its RTTI.
| stream | The stream to write to. |
|
virtual |
Write the identity to a stream.
Slot 3.
| stream | The stream to write to. |
|
virtual |
Read the identity back from a stream.
Slot 4. The members come back in the order Save() wrote them.
| stream | The stream to read from. |