Cockatrice 2026-06-01-Development-3.1.0-beta.3
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
AbstractCounter Class Reference

#include <abstract_counter.h>

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

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

void mousePressEvent (QGraphicsSceneMouseEvent *event) override
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override

Protected Attributes

PlayerLogicplayer
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
TearOffMenumenu = nullptr
bool dialogSemaphore = false
bool deleteAfterDialog = false
bool shownInCounterArea
bool shortcutActive = false

Constructor & Destructor Documentation

◆ AbstractCounter()

AbstractCounter::AbstractCounter ( CounterState * state,
PlayerLogic * player,
bool shownInCounterArea,
bool useNameForShortcut = false,
QGraphicsItem * parent = nullptr )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~AbstractCounter()

AbstractCounter::~AbstractCounter ( )
override

Member Function Documentation

◆ delCounter()

void AbstractCounter::delCounter ( )

◆ getColor()

QColor AbstractCounter::getColor ( ) const
inline
Here is the caller graph for this function:

◆ getId()

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

◆ getMenu()

QMenu * AbstractCounter::getMenu ( ) const
inline
Here is the caller graph for this function:

◆ getName()

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

◆ getRadius()

int AbstractCounter::getRadius ( ) const
inline
Here is the caller graph for this function:

◆ getShownInCounterArea()

bool AbstractCounter::getShownInCounterArea ( ) const
inline

◆ getValue()

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

◆ hoverEnterEvent()

void AbstractCounter::hoverEnterEvent ( QGraphicsSceneHoverEvent * event)
overrideprotected

◆ hoverLeaveEvent()

void AbstractCounter::hoverLeaveEvent ( QGraphicsSceneHoverEvent * event)
overrideprotected

◆ incrementCounter

void AbstractCounter::incrementCounter ( )
privateslot
Here is the caller graph for this function:

◆ mousePressEvent()

void AbstractCounter::mousePressEvent ( QGraphicsSceneMouseEvent * event)
overrideprotected

◆ refreshShortcuts

void AbstractCounter::refreshShortcuts ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ retranslateUi()

void AbstractCounter::retranslateUi ( )
overridevirtual

Retranslate all user-visible strings. Called on language change.

Implements AbstractPlayerComponent.

Here is the caller graph for this function:

◆ setCounter

void AbstractCounter::setCounter ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setShortcutsActive()

void AbstractCounter::setShortcutsActive ( )
overridevirtual

Bind keyboard shortcuts. Called when this player gains focus.

Implements AbstractPlayerComponent.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setShortcutsInactive()

void AbstractCounter::setShortcutsInactive ( )
overridevirtual

Unbind keyboard shortcuts. Called when this player loses focus.

Implements AbstractPlayerComponent.

Member Data Documentation

◆ aDec

QAction * AbstractCounter::aDec = nullptr
private

◆ aInc

QAction * AbstractCounter::aInc = nullptr
private

◆ aSet

QAction* AbstractCounter::aSet = nullptr
private

◆ color

QColor AbstractCounter::color
protected

◆ deleteAfterDialog

bool AbstractCounter::deleteAfterDialog = false
private

◆ dialogSemaphore

bool AbstractCounter::dialogSemaphore = false
private

◆ hovered

bool AbstractCounter::hovered = false
protected

◆ id

int AbstractCounter::id
protected

◆ menu

TearOffMenu* AbstractCounter::menu = nullptr
private

◆ name

QString AbstractCounter::name
protected

◆ player

PlayerLogic* AbstractCounter::player
protected

◆ radius

int AbstractCounter::radius
protected

◆ shortcutActive

bool AbstractCounter::shortcutActive = false
private

◆ shownInCounterArea

bool AbstractCounter::shownInCounterArea
private

◆ useNameForShortcut

bool AbstractCounter::useNameForShortcut
protected

◆ value

int AbstractCounter::value
protected

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