mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 08:52:19 -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
64 lines
1.2 KiB
C++
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
|