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

#include <player_actions.h>

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

Public Types

enum  CardsToReveal { RANDOM_CARD_FROM_ZONE = -2 }

Public Slots

void setLastToken (CardInfoPtr cardInfo)
void playCard (CardItem *c, bool faceDown)
void playCardToTable (const CardItem *c, bool faceDown)
void actUntapAll ()
void actRollDie ()
void actCreateToken ()
void actCreateAnotherToken ()
void actShuffle ()
void actShuffleTop ()
void actShuffleBottom ()
void actDrawCard ()
void actDrawCards ()
void actUndoDraw ()
void actMulligan ()
void actPlay ()
void actPlayFacedown ()
void actHide ()
void actMoveTopCardToPlay ()
void actMoveTopCardToPlayFaceDown ()
void actMoveTopCardToGrave ()
void actMoveTopCardToExile ()
void actMoveTopCardsToGrave ()
void actMoveTopCardsToExile ()
void actMoveTopCardsUntil ()
void actMoveTopCardToBottom ()
void actDrawBottomCard ()
void actDrawBottomCards ()
void actMoveBottomCardToPlay ()
void actMoveBottomCardToPlayFaceDown ()
void actMoveBottomCardToGrave ()
void actMoveBottomCardToExile ()
void actMoveBottomCardsToGrave ()
void actMoveBottomCardsToExile ()
void actMoveBottomCardToTop ()
void actSelectAll ()
void actSelectRow ()
void actSelectColumn ()
void actViewLibrary ()
void actViewHand ()
void actViewTopCards ()
void actViewBottomCards ()
void actAlwaysRevealTopCard ()
void actAlwaysLookAtTopCard ()
void actViewGraveyard ()
void actLendLibrary (int lendToPlayerId)
void actRevealTopCards (int revealToPlayerId, int amount)
void actRevealRandomGraveyardCard (int revealToPlayerId)
void actViewRfg ()
void actViewSideboard ()
void actSayMessage ()
void actOpenDeckInDeckEditor ()
void actCreatePredefinedToken ()
void actCreateRelatedCard ()
void actCreateAllRelatedCards ()
void actMoveCardXCardsFromTop ()
void actCardCounterTrigger ()
void actAttach ()
void actUnattach ()
void actDrawArrow ()
void actIncPT (int deltaP, int deltaT)
void actResetPT ()
void actSetPT ()
void actIncP ()
void actDecP ()
void actIncT ()
void actDecT ()
void actIncPT ()
void actDecPT ()
void actFlowP ()
void actFlowT ()
void actSetAnnotation ()
void actReveal (QAction *action)
void actRevealHand (int revealToPlayerId)
void actRevealRandomHandCard (int revealToPlayerId)
void actRevealLibrary (int revealToPlayerId)
void actSortHand ()
void cardMenuAction ()

Signals

void logSetTapped (Player *player, CardItem *card, bool tapped)
void logSetAnnotation (Player *player, CardItem *card, QString newAnnotation)
void logSetDoesntUntap (Player *player, CardItem *card, bool doesntUntap)
void logSetPT (Player *player, CardItem *card, QString newPT)

Public Member Functions

 PlayerActions (Player *player)
void sendGameCommand (PendingCommand *pend)
void sendGameCommand (const google::protobuf::Message &command)
PendingCommandprepareGameCommand (const ::google::protobuf::Message &cmd)
PendingCommandprepareGameCommand (const QList< const ::google::protobuf::Message * > &cmdList)
void setCardAttrHelper (const GameEventContext &context, CardItem *card, CardAttribute attribute, const QString &avalue, bool allCards, EventProcessingOptions options)
void moveOneCardUntil (CardItem *card)
void stopMoveTopCardsUntil ()
 Immediately stops any ongoing play top card to stack until... process, resetting all variables involved.
bool isMovingCardsUntil () const

Private Member Functions

void createCard (const CardItem *sourceCard, const QString &dbCardName, CardRelationType attach=CardRelationType::DoesNotAttach, bool persistent=false)
bool createRelatedFromRelation (const CardItem *sourceCard, const CardRelation *cardRelation)
void playSelectedCards (bool faceDown=false)
void cmdSetTopCard (Command_MoveCard &cmd)
void cmdSetBottomCard (Command_MoveCard &cmd)
QVariantList parsePT (const QString &pt)

Private Attributes

Playerplayer
int defaultNumberTopCards = 1
int defaultNumberTopCardsToPlaceBelow = 1
int defaultNumberBottomCards = 1
int defaultNumberDieRoll = 20
TokenInfo lastTokenInfo
int lastTokenTableRow
bool movingCardsUntil
QTimer * moveTopCardTimer
QStringList movingCardsUntilExprs = {}
int movingCardsUntilNumberOfHits = 1
bool movingCardsUntilAutoPlay = false
FilterString movingCardsUntilFilter
int movingCardsUntilCounter = 0

Member Enumeration Documentation

◆ CardsToReveal

Enumerator
RANDOM_CARD_FROM_ZONE 

Constructor & Destructor Documentation

◆ PlayerActions()

PlayerActions::PlayerActions ( Player * player)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ actAlwaysLookAtTopCard

void PlayerActions::actAlwaysLookAtTopCard ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actAlwaysRevealTopCard

void PlayerActions::actAlwaysRevealTopCard ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actAttach

void PlayerActions::actAttach ( )
slot
Here is the caller graph for this function:

◆ actCardCounterTrigger

void PlayerActions::actCardCounterTrigger ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actCreateAllRelatedCards

void PlayerActions::actCreateAllRelatedCards ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actCreateAnotherToken

void PlayerActions::actCreateAnotherToken ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actCreatePredefinedToken

void PlayerActions::actCreatePredefinedToken ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actCreateRelatedCard

void PlayerActions::actCreateRelatedCard ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actCreateToken

void PlayerActions::actCreateToken ( )
slot
Here is the call graph for this function:

◆ actDecP

void PlayerActions::actDecP ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actDecPT

void PlayerActions::actDecPT ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actDecT

void PlayerActions::actDecT ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actDrawArrow

void PlayerActions::actDrawArrow ( )
slot
Here is the caller graph for this function:

◆ actDrawBottomCard

void PlayerActions::actDrawBottomCard ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actDrawBottomCards

void PlayerActions::actDrawBottomCards ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actDrawCard

void PlayerActions::actDrawCard ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actDrawCards

void PlayerActions::actDrawCards ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actFlowP

void PlayerActions::actFlowP ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actFlowT

void PlayerActions::actFlowT ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actHide

void PlayerActions::actHide ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actIncP

void PlayerActions::actIncP ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actIncPT [1/2]

void PlayerActions::actIncPT ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actIncPT [2/2]

void PlayerActions::actIncPT ( int deltaP,
int deltaT )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actIncT

void PlayerActions::actIncT ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actLendLibrary

void PlayerActions::actLendLibrary ( int lendToPlayerId)
slot
Here is the call graph for this function:

◆ actMoveBottomCardsToExile

void PlayerActions::actMoveBottomCardsToExile ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveBottomCardsToGrave

void PlayerActions::actMoveBottomCardsToGrave ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveBottomCardToExile

void PlayerActions::actMoveBottomCardToExile ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveBottomCardToGrave

void PlayerActions::actMoveBottomCardToGrave ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveBottomCardToPlay

void PlayerActions::actMoveBottomCardToPlay ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveBottomCardToPlayFaceDown

void PlayerActions::actMoveBottomCardToPlayFaceDown ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveBottomCardToTop

void PlayerActions::actMoveBottomCardToTop ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveCardXCardsFromTop

void PlayerActions::actMoveCardXCardsFromTop ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveTopCardsToExile

void PlayerActions::actMoveTopCardsToExile ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveTopCardsToGrave

void PlayerActions::actMoveTopCardsToGrave ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveTopCardsUntil

void PlayerActions::actMoveTopCardsUntil ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveTopCardToBottom

void PlayerActions::actMoveTopCardToBottom ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveTopCardToExile

void PlayerActions::actMoveTopCardToExile ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveTopCardToGrave

void PlayerActions::actMoveTopCardToGrave ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveTopCardToPlay

void PlayerActions::actMoveTopCardToPlay ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMoveTopCardToPlayFaceDown

void PlayerActions::actMoveTopCardToPlayFaceDown ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actMulligan

void PlayerActions::actMulligan ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actOpenDeckInDeckEditor

void PlayerActions::actOpenDeckInDeckEditor ( )
slot
Here is the caller graph for this function:

◆ actPlay

void PlayerActions::actPlay ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actPlayFacedown

void PlayerActions::actPlayFacedown ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actResetPT

void PlayerActions::actResetPT ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actReveal

void PlayerActions::actReveal ( QAction * action)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actRevealHand

void PlayerActions::actRevealHand ( int revealToPlayerId)
slot
Here is the call graph for this function:

◆ actRevealLibrary

void PlayerActions::actRevealLibrary ( int revealToPlayerId)
slot
Here is the call graph for this function:

◆ actRevealRandomGraveyardCard

void PlayerActions::actRevealRandomGraveyardCard ( int revealToPlayerId)
slot
Here is the call graph for this function:

◆ actRevealRandomHandCard

void PlayerActions::actRevealRandomHandCard ( int revealToPlayerId)
slot
Here is the call graph for this function:

◆ actRevealTopCards

void PlayerActions::actRevealTopCards ( int revealToPlayerId,
int amount )
slot
Here is the call graph for this function:

◆ actRollDie

void PlayerActions::actRollDie ( )
slot
Here is the call graph for this function:

◆ actSayMessage

void PlayerActions::actSayMessage ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actSelectAll

void PlayerActions::actSelectAll ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actSelectColumn

void PlayerActions::actSelectColumn ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actSelectRow

void PlayerActions::actSelectRow ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actSetAnnotation

void PlayerActions::actSetAnnotation ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actSetPT

void PlayerActions::actSetPT ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actShuffle

void PlayerActions::actShuffle ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actShuffleBottom

void PlayerActions::actShuffleBottom ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actShuffleTop

void PlayerActions::actShuffleTop ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actSortHand

void PlayerActions::actSortHand ( )
slot
Here is the call graph for this function:

◆ actUnattach

void PlayerActions::actUnattach ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actUndoDraw

void PlayerActions::actUndoDraw ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ actUntapAll

void PlayerActions::actUntapAll ( )
slot
Here is the call graph for this function:

◆ actViewBottomCards

void PlayerActions::actViewBottomCards ( )
slot
Here is the caller graph for this function:

◆ actViewGraveyard

void PlayerActions::actViewGraveyard ( )
slot
Here is the caller graph for this function:

◆ actViewHand

void PlayerActions::actViewHand ( )
slot

◆ actViewLibrary

void PlayerActions::actViewLibrary ( )
slot
Here is the caller graph for this function:

◆ actViewRfg

void PlayerActions::actViewRfg ( )
slot
Here is the caller graph for this function:

◆ actViewSideboard

void PlayerActions::actViewSideboard ( )
slot
Here is the caller graph for this function:

◆ actViewTopCards

void PlayerActions::actViewTopCards ( )
slot
Here is the caller graph for this function:

◆ cardMenuAction

void PlayerActions::cardMenuAction ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdSetBottomCard()

void PlayerActions::cmdSetBottomCard ( Command_MoveCard & cmd)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmdSetTopCard()

void PlayerActions::cmdSetTopCard ( Command_MoveCard & cmd)
private
Here is the caller graph for this function:

◆ createCard()

void PlayerActions::createCard ( const CardItem * sourceCard,
const QString & dbCardName,
CardRelationType attach = CardRelationType::DoesNotAttach,
bool persistent = false )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createRelatedFromRelation()

bool PlayerActions::createRelatedFromRelation ( const CardItem * sourceCard,
const CardRelation * cardRelation )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isMovingCardsUntil()

bool PlayerActions::isMovingCardsUntil ( ) const
inlinenodiscard

◆ logSetAnnotation

void PlayerActions::logSetAnnotation ( Player * player,
CardItem * card,
QString newAnnotation )
signal
Here is the caller graph for this function:

◆ logSetDoesntUntap

void PlayerActions::logSetDoesntUntap ( Player * player,
CardItem * card,
bool doesntUntap )
signal
Here is the caller graph for this function:

◆ logSetPT

void PlayerActions::logSetPT ( Player * player,
CardItem * card,
QString newPT )
signal
Here is the caller graph for this function:

◆ logSetTapped

void PlayerActions::logSetTapped ( Player * player,
CardItem * card,
bool tapped )
signal
Here is the caller graph for this function:

◆ moveOneCardUntil()

void PlayerActions::moveOneCardUntil ( CardItem * card)
Here is the call graph for this function:

◆ parsePT()

QVariantList PlayerActions::parsePT ( const QString & pt)
private
Here is the caller graph for this function:

◆ playCard

void PlayerActions::playCard ( CardItem * c,
bool faceDown )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ playCardToTable

void PlayerActions::playCardToTable ( const CardItem * card,
bool faceDown )
slot

Like PlayerActions::playCard, but forces the card to be played to the table zone. Cards with tablerow 3 (the stack) will be played to tablerow 1 (the noncreatures row).

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

◆ playSelectedCards()

void PlayerActions::playSelectedCards ( bool faceDown = false)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepareGameCommand() [1/2]

PendingCommand * PlayerActions::prepareGameCommand ( const ::google::protobuf::Message & cmd)
Here is the caller graph for this function:

◆ prepareGameCommand() [2/2]

PendingCommand * PlayerActions::prepareGameCommand ( const QList< const ::google::protobuf::Message * > & cmdList)

◆ sendGameCommand() [1/2]

void PlayerActions::sendGameCommand ( const google::protobuf::Message & command)

◆ sendGameCommand() [2/2]

void PlayerActions::sendGameCommand ( PendingCommand * pend)

◆ setCardAttrHelper()

void PlayerActions::setCardAttrHelper ( const GameEventContext & context,
CardItem * card,
CardAttribute attribute,
const QString & avalue,
bool allCards,
EventProcessingOptions options )
Here is the call graph for this function:

◆ setLastToken

void PlayerActions::setLastToken ( CardInfoPtr cardInfo)
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopMoveTopCardsUntil()

void PlayerActions::stopMoveTopCardsUntil ( )

Immediately stops any ongoing play top card to stack until... process, resetting all variables involved.

Here is the caller graph for this function:

Member Data Documentation

◆ defaultNumberBottomCards

int PlayerActions::defaultNumberBottomCards = 1
private

◆ defaultNumberDieRoll

int PlayerActions::defaultNumberDieRoll = 20
private

◆ defaultNumberTopCards

int PlayerActions::defaultNumberTopCards = 1
private

◆ defaultNumberTopCardsToPlaceBelow

int PlayerActions::defaultNumberTopCardsToPlaceBelow = 1
private

◆ lastTokenInfo

TokenInfo PlayerActions::lastTokenInfo
private

◆ lastTokenTableRow

int PlayerActions::lastTokenTableRow
private

◆ moveTopCardTimer

QTimer* PlayerActions::moveTopCardTimer
private

◆ movingCardsUntil

bool PlayerActions::movingCardsUntil
private

◆ movingCardsUntilAutoPlay

bool PlayerActions::movingCardsUntilAutoPlay = false
private

◆ movingCardsUntilCounter

int PlayerActions::movingCardsUntilCounter = 0
private

◆ movingCardsUntilExprs

QStringList PlayerActions::movingCardsUntilExprs = {}
private

◆ movingCardsUntilFilter

FilterString PlayerActions::movingCardsUntilFilter
private

◆ movingCardsUntilNumberOfHits

int PlayerActions::movingCardsUntilNumberOfHits = 1
private

◆ player

Player* PlayerActions::player
private

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