mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 00:53:57 -07:00
[Game] Add Command Zone support with commander tax tracking
- Add CommandZone and CommandZoneLogic for commander - Add CommanderTaxCounter - Add counter active state protocol (show/hide tax counters) - Add "Enable Command Zone" option in game creation dialogs - Add context menu actions for command zone operations Took 9 minutes Took 11 minutes
This commit is contained in:
parent
18b23b19a7
commit
b4adb20a5f
69 changed files with 1506 additions and 52 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include "../../interface/widgets/menus/tearoff_menu.h"
|
||||
#include "../board/arrow_data.h"
|
||||
#include "../interface/deck_loader/loaded_deck.h"
|
||||
#include "../zones/command_zone_logic.h"
|
||||
#include "../zones/hand_zone_logic.h"
|
||||
#include "../zones/pile_zone_logic.h"
|
||||
#include "../zones/stack_zone_logic.h"
|
||||
|
|
@ -57,6 +58,7 @@ class ServerInfo_Counter;
|
|||
class ServerInfo_Player;
|
||||
class ServerInfo_User;
|
||||
class TabGame;
|
||||
class AbstractCounter;
|
||||
|
||||
const int MAX_TOKENS_PER_DIALOG = 99;
|
||||
|
||||
|
|
@ -87,6 +89,7 @@ signals:
|
|||
void arrowDeleteRequested(int creatorId, int arrowId);
|
||||
void arrowDeleted(int creatorId, int arrowId);
|
||||
void arrowsClearedLocally(); // fires on clear() and processPlayerInfo
|
||||
void commandZoneSupportChanged(bool hasCommandZone);
|
||||
|
||||
public slots:
|
||||
void setActive(bool _active);
|
||||
|
|
@ -191,8 +194,21 @@ public:
|
|||
return qobject_cast<HandZoneLogic *>(zones.value(ZoneNames::HAND));
|
||||
}
|
||||
|
||||
/** @brief Returns the command zone logic, or nullptr if not present. */
|
||||
CommandZoneLogic *getCommandZone()
|
||||
{
|
||||
return qobject_cast<CommandZoneLogic *>(zones.value(ZoneNames::COMMAND));
|
||||
}
|
||||
|
||||
/** @brief Whether the server confirmed command zone support for this game. */
|
||||
bool hasServerCommandZone() const
|
||||
{
|
||||
return serverHasCommandZone;
|
||||
}
|
||||
|
||||
CounterState *addCounter(const ServerInfo_Counter &counter);
|
||||
CounterState *addCounter(int id, const QString &name, const QColor &color, int radius, int value);
|
||||
CounterState *
|
||||
addCounter(int id, const QString &name, const QColor &color, int radius, int value, bool active = true);
|
||||
void delCounter(int counterId);
|
||||
void clearCounters();
|
||||
|
||||
|
|
@ -206,6 +222,9 @@ public:
|
|||
*/
|
||||
CounterState *getLifeCounter() const;
|
||||
|
||||
/** @brief Returns the counter widget for the given ID, or nullptr if not found. */
|
||||
AbstractCounter *getCounterWidget(int counterId) const;
|
||||
|
||||
void setConceded(bool _conceded);
|
||||
bool getConceded() const
|
||||
{
|
||||
|
|
@ -242,6 +261,7 @@ private:
|
|||
QMap<int, CounterState *> counters;
|
||||
|
||||
bool dialogSemaphore;
|
||||
bool serverHasCommandZone;
|
||||
QList<CardItem *> cardsToDelete;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue