Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
counter_state.h
Go to the documentation of this file.
1#ifndef COCKATRICE_COUNTER_STATE_H
2#define COCKATRICE_COUNTER_STATE_H
3
4#include <QColor>
5#include <QObject>
6#include <QString>
7#include <qtmetamacros.h>
8
10
11class CounterState : public QObject
12{
13 Q_OBJECT
14public:
15 CounterState(int id, const QString &name, const QColor &color, int radius, int value, QObject *parent = nullptr);
16
17 static CounterState *fromProto(const ServerInfo_Counter &counter, QObject *parent = nullptr);
18
19 int getId() const
20 {
21 return id;
22 }
23 QString getName() const
24 {
25 return name;
26 }
27 QColor getColor() const
28 {
29 return color;
30 }
31 int getRadius() const
32 {
33 return radius;
34 }
35 int getValue() const
36 {
37 return value;
38 }
39
47 void setValue(int newValue, bool skipDamageAnimation = false);
48
49signals:
56 void valueChanged(int oldValue, int newValue, bool skipDamageAnimation);
57
58private:
59 int id;
60 QString name;
61 QColor color;
62 int radius;
63 int value;
64};
65
66#endif // COCKATRICE_COUNTER_STATE_H
int radius
Definition counter_state.h:62
int getId() const
Definition counter_state.h:19
int id
Definition counter_state.h:59
int getValue() const
Definition counter_state.h:35
int getRadius() const
Definition counter_state.h:31
QString getName() const
Definition counter_state.h:23
int value
Definition counter_state.h:63
void setValue(int newValue, bool skipDamageAnimation=false)
Set the counter value.
Definition counter_state.cpp:18
CounterState(int id, const QString &name, const QColor &color, int radius, int value, QObject *parent=nullptr)
Definition counter_state.cpp:7
QString name
Definition counter_state.h:60
static CounterState * fromProto(const ServerInfo_Counter &counter, QObject *parent=nullptr)
Definition counter_state.cpp:12
QColor getColor() const
Definition counter_state.h:27
QColor color
Definition counter_state.h:61
void valueChanged(int oldValue, int newValue, bool skipDamageAnimation)
Emitted whenever the value changes.
Definition serverinfo_counter.proto:3