Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
CounterState Class Reference

#include <counter_state.h>

Inheritance diagram for CounterState:
[legend]
Collaboration diagram for CounterState:
[legend]

Signals

void valueChanged (int oldValue, int newValue, bool skipDamageAnimation)
 Emitted whenever the value changes.

Public Member Functions

 CounterState (int id, const QString &name, const QColor &color, int radius, int value, QObject *parent=nullptr)
int getId () const
QString getName () const
QColor getColor () const
int getRadius () const
int getValue () const
void setValue (int newValue, bool skipDamageAnimation=false)
 Set the counter value.

Static Public Member Functions

static CounterState * fromProto (const ServerInfo_Counter &counter, QObject *parent=nullptr)

Private Attributes

int id
QString name
QColor color
int radius
int value

Constructor & Destructor Documentation

◆ CounterState()

CounterState::CounterState ( int id,
const QString & name,
const QColor & color,
int radius,
int value,
QObject * parent = nullptr )
Here is the caller graph for this function:

Member Function Documentation

◆ fromProto()

CounterState * CounterState::fromProto ( const ServerInfo_Counter & counter,
QObject * parent = nullptr )
static
Here is the call graph for this function:

◆ getColor()

QColor CounterState::getColor ( ) const
inline

◆ getId()

int CounterState::getId ( ) const
inline
Here is the caller graph for this function:

◆ getName()

QString CounterState::getName ( ) const
inline
Here is the caller graph for this function:

◆ getRadius()

int CounterState::getRadius ( ) const
inline

◆ getValue()

int CounterState::getValue ( ) const
inline
Here is the caller graph for this function:

◆ setValue()

void CounterState::setValue ( int newValue,
bool skipDamageAnimation = false )

Set the counter value.

Parameters
newValueThe new value.
skipDamageAnimationWhen true, valueChanged is emitted with skipDamageAnimation=true, letting views suppress damage-related feedback (e.g. battlefield shimmer, life counter flash) for values set during replay rewinds.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ valueChanged

void CounterState::valueChanged ( int oldValue,
int newValue,
bool skipDamageAnimation )
signal

Emitted whenever the value changes.

Parameters
oldValueThe previous value.
newValueThe new value.
skipDamageAnimationTrue when the change should not trigger damage/life-change feedback in views.
Here is the caller graph for this function:

Member Data Documentation

◆ color

QColor CounterState::color
private

◆ id

int CounterState::id
private

◆ name

QString CounterState::name
private

◆ radius

int CounterState::radius
private

◆ value

int CounterState::value
private

The documentation for this class was generated from the following files: