Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
CardZoneLogic Class Referenceabstract

#include <card_zone_logic.h>

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

Public Slots

void moveAllToZone ()

Signals

void cardAdded (CardItem *addedCard)
void cardCountChanged ()
void reorganizeCards ()
void updateGraphics ()
void setGraphicsVisibility (bool visible)
void retranslateUi ()

Public Member Functions

 CardZoneLogic (Player *_player, const QString &_name, bool _hasCardAttr, bool _isShufflable, bool _contentsKnown, QObject *parent=nullptr)
void addCard (CardItem *card, bool reorganize, int x, int y=-1)
CardItemgetCard (int cardId)
void removeCard (CardItem *card)
virtual CardItemtakeCard (int position, int cardId, bool canResize=true)
void rawInsertCard (CardItem *card, int index)
const CardListgetCards () const
void sortCards (const QList< CardList::SortOption > &options)
QString getName () const
QString getTranslatedName (bool theirOwn, GrammaticalCase gc) const
PlayergetPlayer () const
bool contentsKnown () const
QList< ZoneViewZone * > & getViews ()
void setAlwaysRevealTopCard (bool _alwaysRevealTopCard)
bool getAlwaysRevealTopCard () const
bool getHasCardAttr () const
bool getIsShufflable () const
void clearContents ()

Protected Member Functions

virtual void addCardImpl (CardItem *card, int x, int y)=0

Protected Attributes

Playerplayer
QString name
CardList cards
QList< ZoneViewZone * > views
bool hasCardAttr
bool isShufflable
bool alwaysRevealTopCard

Private Slots

void refreshCardInfos ()

Constructor & Destructor Documentation

◆ CardZoneLogic()

CardZoneLogic::CardZoneLogic ( Player * _player,
const QString & _name,
bool _hasCardAttr,
bool _isShufflable,
bool _contentsKnown,
QObject * parent = nullptr )
explicit
Parameters
_playerthe player that the zone belongs to
_nameinternal name of the zone
_hasCardAttrwhether cards in the zone can have attributes set on them
_isShufflablewhether it makes sense to shuffle this zone by default after viewing it
_contentsKnownwhether the cards in the zone are known to the client
parentthe parent QObject.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ addCard()

void CardZoneLogic::addCard ( CardItem * card,
bool reorganize,
int x,
int y = -1 )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addCardImpl()

virtual void CardZoneLogic::addCardImpl ( CardItem * card,
int x,
int y )
protectedpure virtual

Implemented in HandZoneLogic, PileZoneLogic, StackZoneLogic, TableZoneLogic, and ZoneViewZoneLogic.

Here is the caller graph for this function:

◆ cardAdded

void CardZoneLogic::cardAdded ( CardItem * addedCard)
signal
Here is the caller graph for this function:

◆ cardCountChanged

void CardZoneLogic::cardCountChanged ( )
signal
Here is the caller graph for this function:

◆ clearContents()

void CardZoneLogic::clearContents ( )
Here is the call graph for this function:

◆ contentsKnown()

bool CardZoneLogic::contentsKnown ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getAlwaysRevealTopCard()

bool CardZoneLogic::getAlwaysRevealTopCard ( ) const
inlinenodiscard

◆ getCard()

CardItem * CardZoneLogic::getCard ( int cardId)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCards()

const CardList & CardZoneLogic::getCards ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getHasCardAttr()

bool CardZoneLogic::getHasCardAttr ( ) const
inlinenodiscard

◆ getIsShufflable()

bool CardZoneLogic::getIsShufflable ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getName()

QString CardZoneLogic::getName ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getPlayer()

Player * CardZoneLogic::getPlayer ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ getTranslatedName()

QString CardZoneLogic::getTranslatedName ( bool theirOwn,
GrammaticalCase gc ) const
nodiscard
Here is the caller graph for this function:

◆ getViews()

QList< ZoneViewZone * > & CardZoneLogic::getViews ( )
inline
Here is the caller graph for this function:

◆ moveAllToZone

void CardZoneLogic::moveAllToZone ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rawInsertCard()

void CardZoneLogic::rawInsertCard ( CardItem * card,
int index )
inline
Here is the caller graph for this function:

◆ refreshCardInfos

void CardZoneLogic::refreshCardInfos ( )
privateslot
Here is the caller graph for this function:

◆ removeCard()

void CardZoneLogic::removeCard ( CardItem * card)
Here is the call graph for this function:

◆ reorganizeCards

void CardZoneLogic::reorganizeCards ( )
signal
Here is the caller graph for this function:

◆ retranslateUi

void CardZoneLogic::retranslateUi ( )
signal
Here is the caller graph for this function:

◆ setAlwaysRevealTopCard()

void CardZoneLogic::setAlwaysRevealTopCard ( bool _alwaysRevealTopCard)
inline
Here is the caller graph for this function:

◆ setGraphicsVisibility

void CardZoneLogic::setGraphicsVisibility ( bool visible)
signal
Here is the caller graph for this function:

◆ sortCards()

void CardZoneLogic::sortCards ( const QList< CardList::SortOption > & options)
inline
Here is the caller graph for this function:

◆ takeCard()

CardItem * CardZoneLogic::takeCard ( int position,
int cardId,
bool canResize = true )
virtual

Reimplemented in TableZoneLogic.

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

◆ updateGraphics

void CardZoneLogic::updateGraphics ( )
signal
Here is the caller graph for this function:

Member Data Documentation

◆ alwaysRevealTopCard

bool CardZoneLogic::alwaysRevealTopCard
protected

◆ cards

CardList CardZoneLogic::cards
protected

◆ hasCardAttr

bool CardZoneLogic::hasCardAttr
protected

◆ isShufflable

bool CardZoneLogic::isShufflable
protected

◆ name

QString CardZoneLogic::name
protected

◆ player

Player* CardZoneLogic::player
protected

◆ views

QList<ZoneViewZone *> CardZoneLogic::views
protected

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