mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-17 04:27:45 -07:00
- 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
51 lines
1.6 KiB
C++
51 lines
1.6 KiB
C++
/**
|
|
* @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
|