Cockatrice 2026-06-01-Development-3.1.0-beta.3
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 <libcockatrice/protocol/pb/serverinfo_counter.pb.h>
8
9class CounterState : public QObject
10{
11 Q_OBJECT
12public:
13 CounterState(int id, const QString &name, const QColor &color, int radius, int value, QObject *parent = nullptr);
14
15 static CounterState *fromProto(const ServerInfo_Counter &counter, QObject *parent = nullptr);
16
17 int getId() const
18 {
19 return id;
20 }
21 QString getName() const
22 {
23 return name;
24 }
25 QColor getColor() const
26 {
27 return color;
28 }
29 int getRadius() const
30 {
31 return radius;
32 }
33 int getValue() const
34 {
35 return value;
36 }
37
38 void setValue(int newValue);
39
40signals:
41 void valueChanged(int oldValue, int newValue);
42
43private:
44 int id;
45 QString name;
46 QColor color;
47 int radius;
48 int value;
49};
50
51#endif // COCKATRICE_COUNTER_STATE_H
int radius
Definition counter_state.h:47
int getId() const
Definition counter_state.h:17
int id
Definition counter_state.h:44
void valueChanged(int oldValue, int newValue)
int getValue() const
Definition counter_state.h:33
int getRadius() const
Definition counter_state.h:29
QString getName() const
Definition counter_state.h:21
void setValue(int newValue)
Definition counter_state.cpp:16
int value
Definition counter_state.h:48
CounterState(int id, const QString &name, const QColor &color, int radius, int value, QObject *parent=nullptr)
Definition counter_state.cpp:5
QString name
Definition counter_state.h:45
static CounterState * fromProto(const ServerInfo_Counter &counter, QObject *parent=nullptr)
Definition counter_state.cpp:10
QColor getColor() const
Definition counter_state.h:25
QColor color
Definition counter_state.h:46