[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:
DawnFire42 2026-05-21 21:30:40 -04:00
parent 687e6644bc
commit 75d59e2d82
No known key found for this signature in database
GPG key ID: 24BB855EE2911B33
73 changed files with 1540 additions and 86 deletions

View file

@ -0,0 +1,51 @@
/**
* @file command_zone_logic.h
* @ingroup GameLogicZones
* @brief Logic layer for the command zone, used for Commander format.
*/
#ifndef COCKATRICE_COMMAND_ZONE_LOGIC_H
#define COCKATRICE_COMMAND_ZONE_LOGIC_H
#include "card_zone_logic.h"
/**
* @class CommandZoneLogic
* @brief Logic layer for managing cards in the command zone.
*
* Handles data storage and card management for the command zone in Commander format.
* Supports ordered card insertion for drag-and-drop operations.
*
* @see CommandZone for the graphics layer
* @see CardZoneLogic
*/
class CommandZoneLogic : public CardZoneLogic
{
Q_OBJECT
public:
/**
* @brief Constructs a CommandZoneLogic instance.
* @param _player The player who owns this zone
* @param _name Zone name (ZoneNames::COMMAND)
* @param _hasCardAttr Whether cards in this zone have attributes
* @param _isShufflable Whether the zone can be shuffled
* @param _contentsKnown Whether the zone contents are public knowledge
* @param parent Parent QObject
*/
CommandZoneLogic(PlayerLogic *_player,
const QString &_name,
bool _hasCardAttr,
bool _isShufflable,
bool _contentsKnown,
QObject *parent = nullptr);
protected:
/**
* @brief Adds a card at position x (y ignored). Appends if x is -1 or out of range.
* @param card Card to add
* @param x Insertion index, or -1 to append
* @param y Unused
*/
void addCardImpl(CardItem *card, int x, int y) override;
};
#endif // COCKATRICE_COMMAND_ZONE_LOGIC_H