mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 19:47:46 -07:00
Clang-format (#3028)
* 1/3 Add .clang-format file and travis compilation check * 2/3 Run clang-format * 3/3 Fix compilation problems due to include reordering * 3bis/3 AfterControlStatement: false
This commit is contained in:
parent
8dbdd24c8e
commit
b29bd9e070
272 changed files with 13378 additions and 9535 deletions
|
|
@ -20,18 +20,19 @@
|
|||
#ifndef SERVER_CARDZONE_H
|
||||
#define SERVER_CARDZONE_H
|
||||
|
||||
#include "pb/serverinfo_zone.pb.h"
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QMap>
|
||||
#include <QSet>
|
||||
#include "pb/serverinfo_zone.pb.h"
|
||||
#include <QString>
|
||||
|
||||
class Server_Card;
|
||||
class Server_Player;
|
||||
class Server_Game;
|
||||
class GameEventStorage;
|
||||
|
||||
class Server_CardZone {
|
||||
class Server_CardZone
|
||||
{
|
||||
private:
|
||||
Server_Player *player;
|
||||
QString name;
|
||||
|
|
@ -41,27 +42,49 @@ private:
|
|||
QSet<int> playersWithWritePermission;
|
||||
bool alwaysRevealTopCard;
|
||||
QList<Server_Card *> cards;
|
||||
QMap<int, QMap<int, Server_Card *> > coordinateMap; // y -> (x -> card)
|
||||
QMap<int, QMultiMap<QString, int> > freePilesMap; // y -> (cardName -> x)
|
||||
QMap<int, int> freeSpaceMap; // y -> x
|
||||
QMap<int, QMap<int, Server_Card *>> coordinateMap; // y -> (x -> card)
|
||||
QMap<int, QMultiMap<QString, int>> freePilesMap; // y -> (cardName -> x)
|
||||
QMap<int, int> freeSpaceMap; // y -> x
|
||||
void removeCardFromCoordMap(Server_Card *card, int oldX, int oldY);
|
||||
void insertCardIntoCoordMap(Server_Card *card, int x, int y);
|
||||
|
||||
public:
|
||||
Server_CardZone(Server_Player *_player, const QString &_name, bool _has_coords, ServerInfo_Zone::ZoneType _type);
|
||||
~Server_CardZone();
|
||||
|
||||
const QList<Server_Card *> &getCards() const { return cards; }
|
||||
|
||||
const QList<Server_Card *> &getCards() const
|
||||
{
|
||||
return cards;
|
||||
}
|
||||
int removeCard(Server_Card *card);
|
||||
Server_Card *getCard(int id, int *position = NULL, bool remove = false);
|
||||
|
||||
int getCardsBeingLookedAt() const { return cardsBeingLookedAt; }
|
||||
void setCardsBeingLookedAt(int _cardsBeingLookedAt) { cardsBeingLookedAt = _cardsBeingLookedAt; }
|
||||
bool hasCoords() const { return has_coords; }
|
||||
ServerInfo_Zone::ZoneType getType() const { return type; }
|
||||
QString getName() const { return name; }
|
||||
Server_Player *getPlayer() const { return player; }
|
||||
int getCardsBeingLookedAt() const
|
||||
{
|
||||
return cardsBeingLookedAt;
|
||||
}
|
||||
void setCardsBeingLookedAt(int _cardsBeingLookedAt)
|
||||
{
|
||||
cardsBeingLookedAt = _cardsBeingLookedAt;
|
||||
}
|
||||
bool hasCoords() const
|
||||
{
|
||||
return has_coords;
|
||||
}
|
||||
ServerInfo_Zone::ZoneType getType() const
|
||||
{
|
||||
return type;
|
||||
}
|
||||
QString getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
Server_Player *getPlayer() const
|
||||
{
|
||||
return player;
|
||||
}
|
||||
void getInfo(ServerInfo_Zone *info, Server_Player *playerWhosAsking, bool omniscient);
|
||||
|
||||
|
||||
int getFreeGridColumn(int x, int y, const QString &cardName, bool dontStackSameName) const;
|
||||
bool isColumnEmpty(int x, int y) const;
|
||||
bool isColumnStacked(int x, int y) const;
|
||||
|
|
@ -72,9 +95,18 @@ public:
|
|||
void shuffle();
|
||||
void clear();
|
||||
void addWritePermission(int playerId);
|
||||
const QSet<int> &getPlayersWithWritePermission() const { return playersWithWritePermission; }
|
||||
bool getAlwaysRevealTopCard() const { return alwaysRevealTopCard; }
|
||||
void setAlwaysRevealTopCard(bool _alwaysRevealTopCard) { alwaysRevealTopCard = _alwaysRevealTopCard; }
|
||||
const QSet<int> &getPlayersWithWritePermission() const
|
||||
{
|
||||
return playersWithWritePermission;
|
||||
}
|
||||
bool getAlwaysRevealTopCard() const
|
||||
{
|
||||
return alwaysRevealTopCard;
|
||||
}
|
||||
void setAlwaysRevealTopCard(bool _alwaysRevealTopCard)
|
||||
{
|
||||
alwaysRevealTopCard = _alwaysRevealTopCard;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue