This commit is contained in:
Max-Wilhelm Bruker
2009-11-30 19:33:45 +01:00
parent 55482246dd
commit 59e9416f57
29 changed files with 332 additions and 187 deletions

View File

@@ -6,6 +6,8 @@
#include <QDateTime>
#include "serializable_item.h"
class DeckList;
enum ResponseCode { RespNothing, RespOk, RespInvalidCommand, RespInvalidData, RespNameNotFound, RespLoginNeeded, RespContextError, RespWrongPassword, RespSpectatorsNotAllowed };
// PrivateZone: Contents of the zone are always visible to the owner,
@@ -110,10 +112,12 @@ private:
protected:
void extractData();
public:
ServerInfo_Player(int _playerId = -1, const QString &_name = QString(), const QList<ServerInfo_Zone *> &_zoneList = QList<ServerInfo_Zone *>(), const QList<ServerInfo_Counter *> &_counterList = QList<ServerInfo_Counter *>(), const QList<ServerInfo_Arrow *> &_arrowList = QList<ServerInfo_Arrow *>());
ServerInfo_Player(int _playerId = -1, const QString &_name = QString(), bool _spectator = false, DeckList *_deck = 0, const QList<ServerInfo_Zone *> &_zoneList = QList<ServerInfo_Zone *>(), const QList<ServerInfo_Counter *> &_counterList = QList<ServerInfo_Counter *>(), const QList<ServerInfo_Arrow *> &_arrowList = QList<ServerInfo_Arrow *>());
static SerializableItem *newItem() { return new ServerInfo_Player; }
int getPlayerId() const { return static_cast<SerializableItem_Int *>(itemMap.value("player_id"))->getData(); }
QString getName() const { return static_cast<SerializableItem_String *>(itemMap.value("name"))->getData(); }
bool getSpectator() const { return static_cast<SerializableItem_Bool *>(itemMap.value("spectator"))->getData(); }
DeckList *getDeck() const;
const QList<ServerInfo_Zone *> &getZoneList() const { return zoneList; }
const QList<ServerInfo_Counter *> &getCounterList() const { return counterList; }
const QList<ServerInfo_Arrow *> &getArrowList() const { return arrowList; }