![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <view_zone_logic.h>
Public Types | |
| enum | CardAction { INITIALIZE , ADD_CARD , REMOVE_CARD } |
Signals | |
| void | addToViews () |
| void | removeFromViews () |
| void | closeView () |
| Signals inherited from CardZoneLogic | |
| void | cardAdded (CardItem *addedCard) |
| void | cardCountChanged () |
| void | reorganizeCards () |
| void | updateGraphics () |
| void | setGraphicsVisibility (bool visible) |
| void | retranslateUi () |
Public Member Functions | |
| ZoneViewZoneLogic (PlayerLogic *_player, CardZoneLogic *_origZone, int _numberCards, bool _revealZone, bool _writeableRevealZone, bool _isReversed, QObject *parent=nullptr) | |
| bool | prepareAddCard (int x) |
| void | removeCard (int position, bool toNewZone) |
| void | updateCardIds (CardAction action) |
| void | clearCards () |
| Removes all cards from the view, without touching anything else. Used in replay rewind. | |
| int | getNumberCards () const |
| bool | getRevealZone () const |
| bool | getWriteableRevealZone () const |
| void | setWriteableRevealZone (bool _writeableRevealZone) |
| bool | getIsReversed () const |
| CardZoneLogic * | getOriginalZone () const |
| Public Member Functions inherited from CardZoneLogic | |
| CardZoneLogic (PlayerLogic *_player, const QString &_name, bool _hasCardAttr, bool _isShufflable, bool _contentsKnown, QObject *parent=nullptr) | |
| void | addCard (CardItem *card, bool reorganize, int x, int y=-1) |
| CardItem * | getCard (int cardId) |
| void | removeCard (CardItem *card) |
| virtual CardItem * | takeCard (int position, int cardId, bool canResize=true) |
| void | rawInsertCard (CardItem *card, int index) |
| const CardList & | getCards () const |
| void | sortCards (const QList< CardList::SortOption > &options) |
| QString | getName () const |
| QString | getTranslatedName (bool theirOwn, GrammaticalCase gc) const |
| PlayerLogic * | getPlayer () 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 | |
| void | addCardImpl (CardItem *card, int x, int y) override |
Private Attributes | |
| CardZoneLogic * | origZone |
| int | numberCards |
| bool | revealZone |
| bool | writeableRevealZone |
| bool | isReversed |
Additional Inherited Members | |
| Public Slots inherited from CardZoneLogic | |
| void | moveAllToZone () |
| Protected Attributes inherited from CardZoneLogic | |
| PlayerLogic * | player |
| QString | name |
| CardList | cards |
| QList< ZoneViewZone * > | views |
| bool | hasCardAttr |
| bool | isShufflable |
| bool | alwaysRevealTopCard |
| ZoneViewZoneLogic::ZoneViewZoneLogic | ( | PlayerLogic * | _player, |
| CardZoneLogic * | _origZone, | ||
| int | _numberCards, | ||
| bool | _revealZone, | ||
| bool | _writeableRevealZone, | ||
| bool | _isReversed, | ||
| QObject * | parent = nullptr ) |
| _player | the player that the cards are revealed to. |
| _origZone | the zone the cards were revealed from. |
| _revealZone | if false, the cards will be face down. |
| _writeableRevealZone | whether the player can interact with the revealed cards. |
|
overrideprotectedvirtual |
Make sure prepareAddCard() was called before calling addCard(). This method assumes we already checked that the card is being inserted into the visible portion
Implements CardZoneLogic.
|
signal |
| void ZoneViewZoneLogic::clearCards | ( | ) |
Removes all cards from the view, without touching anything else. Used in replay rewind.
|
signal |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool ZoneViewZoneLogic::prepareAddCard | ( | int | x | ) |
Checks if inserting a card at the given position requires an actual new card to be created and added to the view. Also does any cardId updates that would be required if a card is inserted in that position.
Note that this method can end up modifying the cardIds despite returning false. (for example, if the card is inserted into a hidden portion of the deck while the view is reversed)
Make sure to call this method once before calling addCard(), so that you skip creating a new CardItem and calling addCard() if it's not required.
| x | The position to insert the card at. |
| void ZoneViewZoneLogic::removeCard | ( | int | position, |
| bool | toNewZone ) |
|
signal |
| void ZoneViewZoneLogic::setWriteableRevealZone | ( | bool | _writeableRevealZone | ) |
| void ZoneViewZoneLogic::updateCardIds | ( | CardAction | action | ) |
|
private |
|
private |
|
private |
|
private |
|
private |