mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
Reorganize method/variable definitions, remove unused ones.
Took 1 hour 8 minutes Took 24 seconds
This commit is contained in:
parent
f75389a52b
commit
9beb8e8245
3 changed files with 53 additions and 62 deletions
|
|
@ -47,8 +47,8 @@
|
|||
|
||||
Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, TabGame *_parent)
|
||||
: QObject(_parent), game(_parent), playerInfo(new PlayerInfo(info, _id, _local, _judge)),
|
||||
playerEventHandler(new PlayerEventHandler(this)), playerActions(new PlayerActions(this)), dialogSemaphore(false),
|
||||
active(false)
|
||||
playerEventHandler(new PlayerEventHandler(this)), playerActions(new PlayerActions(this)), active(false),
|
||||
dialogSemaphore(false)
|
||||
{
|
||||
initializeZones();
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ const int MAX_TOKENS_PER_DIALOG = 99;
|
|||
class Player : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
void openDeckEditor(const DeckLoader *deck);
|
||||
void newCardAdded(AbstractCardItem *card);
|
||||
|
|
@ -74,9 +75,35 @@ public:
|
|||
~Player() override;
|
||||
void retranslateUi();
|
||||
|
||||
[[nodiscard]] PlayerInfo *getPlayerInfo() const
|
||||
void initializeZones();
|
||||
void updateZones();
|
||||
void clear();
|
||||
|
||||
void processPlayerInfo(const ServerInfo_Player &info);
|
||||
void processCardAttachment(const ServerInfo_Player &info);
|
||||
|
||||
void addCard(CardItem *c);
|
||||
void deleteCard(CardItem *c);
|
||||
|
||||
bool clearCardsToDelete();
|
||||
|
||||
bool getActive() const
|
||||
{
|
||||
return playerInfo;
|
||||
return active;
|
||||
}
|
||||
|
||||
TabGame *getGame() const
|
||||
{
|
||||
return game;
|
||||
}
|
||||
|
||||
GameScene *getGameScene();
|
||||
|
||||
[[nodiscard]] PlayerGraphicsItem *getGraphicsItem();
|
||||
|
||||
[[nodiscard]] PlayerActions *getPlayerActions() const
|
||||
{
|
||||
return playerActions;
|
||||
};
|
||||
|
||||
[[nodiscard]] PlayerEventHandler *getPlayerEventHandler() const
|
||||
|
|
@ -84,19 +111,14 @@ public:
|
|||
return playerEventHandler;
|
||||
}
|
||||
|
||||
[[nodiscard]] PlayerActions *getPlayerActions() const
|
||||
[[nodiscard]] PlayerInfo *getPlayerInfo() const
|
||||
{
|
||||
return playerActions;
|
||||
return playerInfo;
|
||||
};
|
||||
|
||||
TabGame *getGame() const
|
||||
[[nodiscard]] PlayerMenu *getPlayerMenu() const
|
||||
{
|
||||
return game;
|
||||
}
|
||||
|
||||
const QMap<int, ArrowItem *> &getArrows() const
|
||||
{
|
||||
return arrows;
|
||||
return playerMenu;
|
||||
}
|
||||
|
||||
template <typename T> T *addZone(T *zone)
|
||||
|
|
@ -105,16 +127,16 @@ public:
|
|||
return zone;
|
||||
}
|
||||
|
||||
const QMap<QString, CardZoneLogic *> &getZones() const
|
||||
{
|
||||
return zones;
|
||||
}
|
||||
|
||||
CardZoneLogic *getZone(const QString zoneName)
|
||||
{
|
||||
return zones.value(zoneName);
|
||||
}
|
||||
|
||||
const QMap<QString, CardZoneLogic *> &getZones() const
|
||||
{
|
||||
return zones;
|
||||
}
|
||||
|
||||
PileZoneLogic *getDeckZone()
|
||||
{
|
||||
return qobject_cast<PileZoneLogic *>(zones.value("deck"));
|
||||
|
|
@ -150,43 +172,12 @@ public:
|
|||
return qobject_cast<HandZoneLogic *>(zones.value("hand"));
|
||||
}
|
||||
|
||||
void updateZones();
|
||||
|
||||
void clear();
|
||||
void initializeZones();
|
||||
|
||||
bool getActive() const
|
||||
{
|
||||
return active;
|
||||
}
|
||||
|
||||
[[nodiscard]] PlayerGraphicsItem *getGraphicsItem();
|
||||
|
||||
GameScene *getGameScene();
|
||||
|
||||
PlayerMenu *getPlayerMenu() const
|
||||
{
|
||||
return playerMenu;
|
||||
}
|
||||
|
||||
void setDialogSemaphore(const bool _active)
|
||||
{
|
||||
dialogSemaphore = _active;
|
||||
}
|
||||
|
||||
void processPlayerInfo(const ServerInfo_Player &info);
|
||||
void processCardAttachment(const ServerInfo_Player &info);
|
||||
|
||||
void addCard(CardItem *c);
|
||||
void deleteCard(CardItem *c);
|
||||
|
||||
bool clearCardsToDelete();
|
||||
|
||||
AbstractCounter *addCounter(const ServerInfo_Counter &counter);
|
||||
AbstractCounter *addCounter(int counterId, const QString &name, QColor color, int radius, int value);
|
||||
void delCounter(int counterId);
|
||||
void clearCounters();
|
||||
void incrementAllCardCounters();
|
||||
|
||||
QMap<int, AbstractCounter *> getCounters()
|
||||
{
|
||||
return counters;
|
||||
|
|
@ -198,8 +189,18 @@ public:
|
|||
void removeArrow(ArrowItem *arrow);
|
||||
void clearArrows();
|
||||
|
||||
const QMap<int, ArrowItem *> &getArrows() const
|
||||
{
|
||||
return arrows;
|
||||
}
|
||||
|
||||
void setGameStarted();
|
||||
|
||||
void setDialogSemaphore(const bool _active)
|
||||
{
|
||||
dialogSemaphore = _active;
|
||||
}
|
||||
|
||||
private:
|
||||
TabGame *game;
|
||||
PlayerInfo *playerInfo;
|
||||
|
|
@ -208,6 +209,8 @@ private:
|
|||
PlayerMenu *playerMenu;
|
||||
PlayerGraphicsItem *graphicsItem;
|
||||
|
||||
bool active;
|
||||
|
||||
QMap<QString, CardZoneLogic *> zones;
|
||||
QMap<int, AbstractCounter *> counters;
|
||||
QMap<int, ArrowItem *> arrows;
|
||||
|
|
@ -215,8 +218,6 @@ private:
|
|||
bool dialogSemaphore;
|
||||
QList<CardItem *> cardsToDelete;
|
||||
|
||||
bool active;
|
||||
|
||||
// void eventConnectionStateChanged(const Event_ConnectionStateChanged &event);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -28,16 +28,6 @@ public:
|
|||
DeckLoader *deck;
|
||||
QStringList predefinedTokens;
|
||||
|
||||
StackZone *stack;
|
||||
TableZone *table;
|
||||
HandZone *hand;
|
||||
PlayerTarget *playerTarget;
|
||||
|
||||
PlayerTarget *getPlayerTarget() const
|
||||
{
|
||||
return playerTarget;
|
||||
}
|
||||
|
||||
int getZoneId() const
|
||||
{
|
||||
return zoneId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue