wavelength 1.0.0
Loading...
Searching...
No Matches
lobbyplayer.h
Go to the documentation of this file.
1#pragma once
2
5#include "os/datetime.h"
6#include "os/prnstream.h"
7#include "os/string.h"
8
9class RatingStat;
10
17public:
25
33
43 bool IsNewbie() const;
44
54 void SetRating(const RatingStat *pStat);
55
57 const AvatarPartSet &GetAvatar() const {
58 return mAvatar;
59 }
60
63 return mAvatar;
64 }
65
67 void SetAvatar(const AvatarPartSet &avatar) {
68 mAvatar = avatar;
69 }
70
72 int GetChannelId() const {
73 return mChannelId;
74 }
75
77 void SetChannelId(int nChannelId) {
78 mChannelId = nChannelId;
79 }
80
82 int GetConnectionType() const {
83 return mConnectionType;
84 }
85
87 void SetConnectionType(int nConnectionType) {
88 mConnectionType = nConnectionType;
89 }
90
92 int GetGames() const {
93 return mGames;
94 }
95
97 void SetGames(int nGames) {
98 mGames = nGames;
99 }
100
102 int GetId() const {
103 return mId;
104 }
105
107 void SetId(int nId) {
108 mId = nId;
109 }
110
112 const DateTime &GetLastOnline() const {
113 return mLastOnline;
114 }
115
118 return mLastOnline;
119 }
120
122 void SetLastOnline(const DateTime &lastOnline) {
123 mLastOnline = lastOnline;
124 }
125
127 int GetMuted() const {
128 return mMuted;
129 }
130
132 void SetMuted(int nMuted) {
133 mMuted = nMuted;
134 }
135
137 const String &GetName() const {
138 return mName;
139 }
140
143 return mName;
144 }
145
147 void SetName(const char *pszName) {
148 mName = pszName;
149 }
150
152 int GetRank() const {
153 return mRank;
154 }
155
157 void SetRank(int nRank) {
158 mRank = nRank;
159 }
160
162 int GetRankIcon() const {
163 return mRankIcon;
164 }
165
167 void SetRankIcon(int nRankIcon) {
168 mRankIcon = nRankIcon;
169 }
170
172 int GetRating() const {
173 return mRating;
174 }
175
177 void SetRating(int nRating) {
178 mRating = nRating;
179 }
180
182 const RatingRecord &GetRecord() const {
183 return mRecord;
184 }
185
188 return mRecord;
189 }
190
192 void SetRecord(const RatingRecord &record) {
193 mRecord = record;
194 }
195
196private:
197 int mId;
198 String mName;
199 int mConnectionType;
200 int mRank;
201 int mMuted;
202 int mChannelId;
203 int mRating;
204 int mGames;
205 int mRankIcon;
206 DateTime mLastOnline;
207 AvatarPartSet mAvatar;
208 RatingRecord mRecord;
209};
210
221PrnStream &operator<<(PrnStream &stream, const LobbyPlayer &player);
Parts and colours of a player's avatar, the Freq the Freq maker edits.
Definition avatarpartset.h:23
Local date and time of the console clock.
Definition datetime.h:14
A player of the lobby server, as FindPlayerMsg reports it.
Definition lobbyplayer.h:16
int GetRankIcon() const
Definition lobbyplayer.h:162
int GetChannelId() const
Definition lobbyplayer.h:72
DateTime & GetLastOnline()
Definition lobbyplayer.h:117
int GetId() const
Definition lobbyplayer.h:102
void SetAvatar(const AvatarPartSet &avatar)
Definition lobbyplayer.h:67
int GetMuted() const
Definition lobbyplayer.h:127
void SetRecord(const RatingRecord &record)
Definition lobbyplayer.h:192
void SetName(const char *pszName)
Definition lobbyplayer.h:147
AvatarPartSet & GetAvatar()
Definition lobbyplayer.h:62
void SetChannelId(int nChannelId)
Definition lobbyplayer.h:77
void SetRankIcon(int nRankIcon)
Definition lobbyplayer.h:167
const AvatarPartSet & GetAvatar() const
Definition lobbyplayer.h:57
const RatingRecord & GetRecord() const
Definition lobbyplayer.h:182
int GetGames() const
Definition lobbyplayer.h:92
RatingRecord & GetRecord()
Definition lobbyplayer.h:187
int GetRating() const
Definition lobbyplayer.h:172
void SetConnectionType(int nConnectionType)
Definition lobbyplayer.h:87
void SetId(int nId)
Definition lobbyplayer.h:107
void SetMuted(int nMuted)
Definition lobbyplayer.h:132
const String & GetName() const
Definition lobbyplayer.h:137
void SetRating(int nRating)
Definition lobbyplayer.h:177
bool IsNewbie() const
Report whether the player is new to the online game.
void SetRating(const RatingStat *pStat)
Take the rating and the record of a rated player.
ConnectionType
Values of mConnectionType.
Definition lobbyplayer.h:19
@ kConnectionSlow
Definition lobbyplayer.h:21
@ kConnectionNone
Definition lobbyplayer.h:20
@ kConnectionFast
Definition lobbyplayer.h:22
@ kConnectionOffline
Definition lobbyplayer.h:23
void SetRank(int nRank)
Definition lobbyplayer.h:157
String & GetName()
Definition lobbyplayer.h:142
int GetConnectionType() const
Definition lobbyplayer.h:82
void SetLastOnline(const DateTime &lastOnline)
Definition lobbyplayer.h:122
LobbyPlayer()
Construct a player with no name, the default Freq, and no rank.
int GetRank() const
Definition lobbyplayer.h:152
const DateTime & GetLastOnline() const
Definition lobbyplayer.h:112
void SetGames(int nGames)
Definition lobbyplayer.h:97
Text output stream.
Definition prnstream.h:16
The rating of one player of an online game, and the results that rate the player afterwards.
Definition ratingstat.h:14
Growable text buffer that is also a PrnStream.
Definition string.h:19
PrnStream & operator<<(PrnStream &stream, const LobbyPlayer &player)
Write a player as its identifier, name, rating, rank, rank icon, games, record, mute state,...
The results of the online games of a player that the next rating weighs.
Definition ratingrecord.h:10