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

#include <card_state.h>

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

Signals

void stateChanged ()
void attackingChanged (bool newValue)
void countersChanged (const QMap< int, int > &newCounters)
void annotationChanged (const QString &newAnnotation)
void ptChanged (const QString &newPt)
void doesntUntapChanged (bool newValue)
void destroyOnZoneChangeChanged (bool newValue)
void attachedToChanged (CardItem *newAttachedTo)
void zoneChanged (CardState *changedCard, CardZoneLogic *newZone)

Public Member Functions

 CardState (QObject *parent, CardZoneLogic *_zone)
void resetState (bool keepAnnotations)
CardZoneLogicgetZone () const
void setZone (CardZoneLogic *_zone)
bool getAttacking () const
void setAttacking (bool _attacking)
const QMap< int, int > & getCounters () const
void insertCounter (int id, int value)
void setCounter (int id, int value)
void clearCounters ()
QString getAnnotation () const
void setAnnotation (const QString &_annotation)
QString getPT () const
void setPT (const QString &_pt)
bool getDoesntUntap () const
void setDoesntUntap (bool _doesntUntap)
bool getDestroyOnZoneChange () const
void setDestroyOnZoneChange (bool _destroyOnZoneChange)
CardItemgetAttachedTo () const
void setAttachedTo (CardItem *_attachedTo)

Private Attributes

bool attacking = false
QMap< int, int > counters
QString annotation
QString pt
bool doesntUntap = false
bool destroyOnZoneChange = false
CardItemattachedTo = nullptr
CardZoneLogiczone = nullptr

Constructor & Destructor Documentation

◆ CardState()

CardState::CardState ( QObject * parent,
CardZoneLogic * _zone )
inlineexplicit
Here is the caller graph for this function:

Member Function Documentation

◆ annotationChanged

void CardState::annotationChanged ( const QString & newAnnotation)
signal
Here is the caller graph for this function:

◆ attachedToChanged

void CardState::attachedToChanged ( CardItem * newAttachedTo)
signal
Here is the caller graph for this function:

◆ attackingChanged

void CardState::attackingChanged ( bool newValue)
signal
Here is the caller graph for this function:

◆ clearCounters()

void CardState::clearCounters ( )
Here is the call graph for this function:

◆ countersChanged

void CardState::countersChanged ( const QMap< int, int > & newCounters)
signal
Here is the caller graph for this function:

◆ destroyOnZoneChangeChanged

void CardState::destroyOnZoneChangeChanged ( bool newValue)
signal
Here is the caller graph for this function:

◆ doesntUntapChanged

void CardState::doesntUntapChanged ( bool newValue)
signal
Here is the caller graph for this function:

◆ getAnnotation()

QString CardState::getAnnotation ( ) const
inline

◆ getAttachedTo()

CardItem * CardState::getAttachedTo ( ) const
inline

◆ getAttacking()

bool CardState::getAttacking ( ) const
inline

◆ getCounters()

const QMap< int, int > & CardState::getCounters ( ) const
inline

◆ getDestroyOnZoneChange()

bool CardState::getDestroyOnZoneChange ( ) const
inline

◆ getDoesntUntap()

bool CardState::getDoesntUntap ( ) const
inline

◆ getPT()

QString CardState::getPT ( ) const
inline

◆ getZone()

CardZoneLogic * CardState::getZone ( ) const
inline

◆ insertCounter()

void CardState::insertCounter ( int id,
int value )
Here is the call graph for this function:

◆ ptChanged

void CardState::ptChanged ( const QString & newPt)
signal
Here is the caller graph for this function:

◆ resetState()

void CardState::resetState ( bool keepAnnotations)

◆ setAnnotation()

void CardState::setAnnotation ( const QString & _annotation)
Here is the call graph for this function:

◆ setAttachedTo()

void CardState::setAttachedTo ( CardItem * _attachedTo)
Here is the call graph for this function:

◆ setAttacking()

void CardState::setAttacking ( bool _attacking)
Here is the call graph for this function:

◆ setCounter()

void CardState::setCounter ( int id,
int value )
Here is the call graph for this function:

◆ setDestroyOnZoneChange()

void CardState::setDestroyOnZoneChange ( bool _destroyOnZoneChange)
Here is the call graph for this function:

◆ setDoesntUntap()

void CardState::setDoesntUntap ( bool _doesntUntap)
Here is the call graph for this function:

◆ setPT()

void CardState::setPT ( const QString & _pt)
Here is the call graph for this function:

◆ setZone()

void CardState::setZone ( CardZoneLogic * _zone)
Here is the call graph for this function:

◆ stateChanged

void CardState::stateChanged ( )
signal
Here is the caller graph for this function:

◆ zoneChanged

void CardState::zoneChanged ( CardState * changedCard,
CardZoneLogic * newZone )
signal
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ annotation

QString CardState::annotation
private

◆ attachedTo

CardItem* CardState::attachedTo = nullptr
private

◆ attacking

bool CardState::attacking = false
private

◆ counters

QMap<int, int> CardState::counters
private

◆ destroyOnZoneChange

bool CardState::destroyOnZoneChange = false
private

◆ doesntUntap

bool CardState::doesntUntap = false
private

◆ pt

QString CardState::pt
private

◆ zone

CardZoneLogic* CardState::zone = nullptr
private

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