resonance 1.0.1
Loading...
Searching...
No Matches
playerinfo.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4#include <vector>
5
7#include "os/hxstr.h"
8#include "stream/ibstream.h"
9#include "stream/obstream.h"
10
40public:
53 }
54
69 PlayerInfo(unsigned nPlayerId,
70 const HxStr &colorName,
71 const FreqAppearance &appearance,
72 int nTrack)
73 : mPlayerId(nPlayerId), mColorName(colorName), mAppearance(appearance), mTrack(nTrack),
74 mActive(1), mReady(0), mOriginalId(nPlayerId) {
75 }
76
83 virtual ~PlayerInfo();
84
95 virtual void Print(std::ostream &stream) const;
96
106 virtual void Save(OBStream &stream) const;
107
117 virtual void Load(IBStream &stream);
118
119private:
120 // Streamed through a different ostream overload than the int members below, and loaded and
121 // stored as four bytes, which is what types it as unsigned rather than as int.
122 unsigned mPlayerId; // +0x00
123 HxStr mColorName; // +0x04
124 FreqAppearance mAppearance; // +0x0c
125 int mTrack; // +0x20
126 int mActive; // +0x24
127 int mReady; // +0x28
128 int mOriginalId; // +0x2c
129 std::vector<int> mEntries; // +0x30 element type not recovered
130};
Appearance of a player's avatar.
Definition freqappearance.h:39
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Input half of the byte stream interface.
Definition ibstream.h:36
Output half of the byte stream interface.
Definition obstream.h:25
PlayerInfo(unsigned nPlayerId, const HxStr &colorName, const FreqAppearance &appearance, int nTrack)
Construct an identity from its parts.
Definition playerinfo.h:69
PlayerInfo()
Construct an empty identity.
Definition playerinfo.h:52
virtual ~PlayerInfo()
Release the vector, the appearance, and the name.
virtual void Save(OBStream &stream) const
Write the identity to a stream.
virtual void Print(std::ostream &stream) const
Write the identity to a diagnostic stream.
virtual void Load(IBStream &stream)
Read the identity back from a stream.