reworked protocol; only server code for now

This commit is contained in:
Max-Wilhelm Bruker 2009-10-24 21:20:26 +02:00
parent da6a1a0dbd
commit a8c45fda1a
13 changed files with 669 additions and 534 deletions

View file

@ -25,7 +25,7 @@
class Card;
class ServerSocket;
class AbstractRNG;
class Player;
class PlayerZone {
public:
@ -39,13 +39,13 @@ public:
// list index, whereas cards in any other zone are referenced by their ids.
enum ZoneType { PrivateZone, PublicZone, HiddenZone };
private:
ServerSocket *player;
Player *player;
QString name;
bool has_coords;
ZoneType type;
int cardsBeingLookedAt;
public:
PlayerZone(ServerSocket *_player, const QString &_name, bool _has_coords, ZoneType _type);
PlayerZone(Player *_player, const QString &_name, bool _has_coords, ZoneType _type);
~PlayerZone();
Card *getCard(int id, bool remove, int *position = NULL);
@ -55,11 +55,11 @@ public:
bool hasCoords() const { return has_coords; }
ZoneType getType() const { return type; }
QString getName() const { return name; }
ServerSocket *getPlayer() const { return player; }
Player *getPlayer() const { return player; }
QList<Card *> cards;
void insertCard(Card *card, int x, int y);
void shuffle(AbstractRNG *rnd);
void shuffle();
void clear();
};