![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <abstract_counter.h>
Public Member Functions | |
| AbstractCounter (CounterState *state, PlayerLogic *player, bool shownInCounterArea, bool useNameForShortcut=false, QGraphicsItem *parent=nullptr) | |
| ~AbstractCounter () override | |
| void | retranslateUi () override |
| Retranslate all user-visible strings. Called on language change. | |
| void | setShortcutsActive () override |
| Bind keyboard shortcuts. Called when this player gains focus. | |
| void | setShortcutsInactive () override |
| Unbind keyboard shortcuts. Called when this player loses focus. | |
| void | delCounter () |
| QMenu * | getMenu () const |
| int | getId () const |
| QString | getName () const |
| QColor | getColor () const |
| int | getRadius () const |
| int | getValue () const |
| bool | getShownInCounterArea () const |
| Public Member Functions inherited from AbstractPlayerComponent | |
| virtual | ~AbstractPlayerComponent ()=default |
Protected Member Functions | |
| virtual void | onValueChanged (int oldValue, int newValue, bool skipDamageAnimation) |
| Hook for subclasses that need per-value-change feedback (e.g. life-total flash). | |
| void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
| void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) override |
| void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override |
Protected Attributes | |
| PlayerLogic * | player |
| int | id |
| QString | name |
| int | value |
| QColor | color |
| int | radius |
| bool | hovered = false |
| bool | useNameForShortcut |
Private Slots | |
| void | refreshShortcuts () |
| void | incrementCounter () |
| void | setCounter () |
Private Attributes | |
| QAction * | aSet = nullptr |
| QAction * | aDec = nullptr |
| QAction * | aInc = nullptr |
| TearOffMenu * | menu = nullptr |
| bool | dialogSemaphore = false |
| bool | deleteAfterDialog = false |
| bool | shownInCounterArea |
| bool | shortcutActive = false |
| AbstractCounter::AbstractCounter | ( | CounterState * | state, |
| PlayerLogic * | player, | ||
| bool | shownInCounterArea, | ||
| bool | useNameForShortcut = false, | ||
| QGraphicsItem * | parent = nullptr ) |
|
override |
| void AbstractCounter::delCounter | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
overrideprotected |
|
overrideprotected |
|
privateslot |
|
overrideprotected |
|
protectedvirtual |
Hook for subclasses that need per-value-change feedback (e.g. life-total flash).
Called whenever the counter's value changes, before the item repaints.
| skipDamageAnimation | True when damage-related feedback should be suppressed (replay rewinds). |
Reimplemented in PlayerCounter.
|
privateslot |
|
overridevirtual |
Retranslate all user-visible strings. Called on language change.
Implements AbstractPlayerComponent.
|
privateslot |
|
overridevirtual |
Bind keyboard shortcuts. Called when this player gains focus.
Implements AbstractPlayerComponent.
|
overridevirtual |
Unbind keyboard shortcuts. Called when this player loses focus.
Implements AbstractPlayerComponent.
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
protected |
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
private |
|
private |
|
protected |
|
protected |