Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
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
9
class
ServerInfo_Counter
;
10
11
class
CounterState
:
public
QObject
12
{
13
Q_OBJECT
14
public
:
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
49
signals:
56
void
valueChanged
(
int
oldValue,
int
newValue,
bool
skipDamageAnimation);
57
58
private
:
59
int
id
;
60
QString
name
;
61
QColor
color
;
62
int
radius
;
63
int
value
;
64
};
65
66
#endif
// COCKATRICE_COUNTER_STATE_H
CounterState::radius
int radius
Definition
counter_state.h:62
CounterState::getId
int getId() const
Definition
counter_state.h:19
CounterState::id
int id
Definition
counter_state.h:59
CounterState::getValue
int getValue() const
Definition
counter_state.h:35
CounterState::getRadius
int getRadius() const
Definition
counter_state.h:31
CounterState::getName
QString getName() const
Definition
counter_state.h:23
CounterState::value
int value
Definition
counter_state.h:63
CounterState::setValue
void setValue(int newValue, bool skipDamageAnimation=false)
Set the counter value.
Definition
counter_state.cpp:18
CounterState::CounterState
CounterState(int id, const QString &name, const QColor &color, int radius, int value, QObject *parent=nullptr)
Definition
counter_state.cpp:7
CounterState::name
QString name
Definition
counter_state.h:60
CounterState::fromProto
static CounterState * fromProto(const ServerInfo_Counter &counter, QObject *parent=nullptr)
Definition
counter_state.cpp:12
CounterState::getColor
QColor getColor() const
Definition
counter_state.h:27
CounterState::color
QColor color
Definition
counter_state.h:61
CounterState::valueChanged
void valueChanged(int oldValue, int newValue, bool skipDamageAnimation)
Emitted whenever the value changes.
ServerInfo_Counter
Definition
serverinfo_counter.proto:3
cockatrice
src
game
board
counter_state.h
Generated by
1.18.0