Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
player_actions.cpp File Reference
#include "player_actions.h"
#include "../../interface/widgets/tabs/tab_game.h"
#include "../../interface/widgets/utility/get_text_with_max.h"
#include "../board/card_item.h"
#include "../dialogs/dlg_move_top_cards_until.h"
#include "../dialogs/dlg_roll_dice.h"
#include "../zones/hand_zone.h"
#include "../zones/logic/view_zone_logic.h"
#include "../zones/table_zone.h"
#include "card_menu_action_type.h"
#include <libcockatrice/card/database/card_database_manager.h>
#include <libcockatrice/card/relation/card_relation.h>
#include <libcockatrice/protocol/pb/command_attach_card.pb.h>
#include <libcockatrice/protocol/pb/command_change_zone_properties.pb.h>
#include <libcockatrice/protocol/pb/command_create_token.pb.h>
#include <libcockatrice/protocol/pb/command_draw_cards.pb.h>
#include <libcockatrice/protocol/pb/command_flip_card.pb.h>
#include <libcockatrice/protocol/pb/command_game_say.pb.h>
#include <libcockatrice/protocol/pb/command_move_card.pb.h>
#include <libcockatrice/protocol/pb/command_mulligan.pb.h>
#include <libcockatrice/protocol/pb/command_reveal_cards.pb.h>
#include <libcockatrice/protocol/pb/command_roll_die.pb.h>
#include <libcockatrice/protocol/pb/command_set_card_attr.pb.h>
#include <libcockatrice/protocol/pb/command_set_card_counter.pb.h>
#include <libcockatrice/protocol/pb/command_shuffle.pb.h>
#include <libcockatrice/protocol/pb/command_undo_draw.pb.h>
#include <libcockatrice/protocol/pb/context_move_card.pb.h>
#include <libcockatrice/utility/trice_limits.h>
Include dependency graph for player_actions.cpp:

Functions

static QList< CardList::SortOptionexpandSortOption (CardList::SortOption option)
 The sortHand actions only pass along a single SortOption in its data. This method fills out the rest of the sort priority list given that option.
static void selectCardsInZone (const CardZoneLogic *zone, std::function< bool(const CardItem *)> filter=[](const CardItem *) { return true;})
static bool isUnwritableRevealZone (CardZoneLogic *zone)
 returns true if the zone is a unwritable reveal zone view (eg a card reveal window). Will return false if zone is nullptr.

Variables

static constexpr int MOVE_TOP_CARD_UNTIL_INTERVAL = 100

Function Documentation

◆ expandSortOption()

QList< CardList::SortOption > expandSortOption ( CardList::SortOption option)
static

The sortHand actions only pass along a single SortOption in its data. This method fills out the rest of the sort priority list given that option.

Parameters
optionThe single sort option
Returns
The sort priority list
Here is the caller graph for this function:

◆ isUnwritableRevealZone()

bool isUnwritableRevealZone ( CardZoneLogic * zone)
static

returns true if the zone is a unwritable reveal zone view (eg a card reveal window). Will return false if zone is nullptr.

◆ selectCardsInZone()

void selectCardsInZone ( const CardZoneLogic * zone,
std::function< bool(const CardItem *)> filter = [](const CardItem *) { return true; } )
static

Selects all cards in the given zone.

Parameters
zoneThe zone to select from
filterA predicate to filter which cards are selected. Defaults to always returning true.
Here is the caller graph for this function:

Variable Documentation

◆ MOVE_TOP_CARD_UNTIL_INTERVAL

int MOVE_TOP_CARD_UNTIL_INTERVAL = 100
staticconstexpr