Cockatrice/cockatrice/src/game/board/counter_state.h
DawnFire42 6ea68c3f58
[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
2026-08-10 18:32:17 -04:00

64 lines
1.2 KiB
C++

#ifndef COCKATRICE_COUNTER_STATE_H
#define COCKATRICE_COUNTER_STATE_H
#include <QColor>
#include <QObject>
#include <QString>
#include <libcockatrice/protocol/pb/serverinfo_counter.pb.h>
class CounterState : public QObject
{
Q_OBJECT
public:
CounterState(int id,
const QString &name,
const QColor &color,
int radius,
int value,
bool active = true,
QObject *parent = nullptr);
static CounterState *fromProto(const ServerInfo_Counter &counter, QObject *parent = nullptr);
int getId() const
{
return id;
}
QString getName() const
{
return name;
}
QColor getColor() const
{
return color;
}
int getRadius() const
{
return radius;
}
int getValue() const
{
return value;
}
bool isActive() const
{
return active;
}
void setValue(int newValue);
void setActive(bool newActive);
signals:
void valueChanged(int oldValue, int newValue);
void activeChanged(bool newActive);
private:
int id;
QString name;
QColor color;
int radius;
int value;
bool active;
};
#endif // COCKATRICE_COUNTER_STATE_H