Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
server_abstract_player.cpp File Reference
#include "server_abstract_player.h"
#include "server_arrow.h"
#include "server_card.h"
#include "server_cardzone.h"
#include "server_game.h"
#include "server_move_card_struct.h"
#include <QDebug>
#include <QRegularExpression>
#include <algorithm>
#include <libcockatrice/deck_list/deck_list.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_arrow.pb.h>
#include <libcockatrice/protocol/pb/command_create_token.pb.h>
#include <libcockatrice/protocol/pb/command_delete_arrow.pb.h>
#include <libcockatrice/protocol/pb/command_dump_zone.pb.h>
#include <libcockatrice/protocol/pb/command_flip_card.pb.h>
#include <libcockatrice/protocol/pb/command_inc_card_counter.pb.h>
#include <libcockatrice/protocol/pb/command_move_card.pb.h>
#include <libcockatrice/protocol/pb/command_ready_start.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/context_concede.pb.h>
#include <libcockatrice/protocol/pb/context_move_card.pb.h>
#include <libcockatrice/protocol/pb/context_ready_start.pb.h>
#include <libcockatrice/protocol/pb/context_undo_draw.pb.h>
#include <libcockatrice/protocol/pb/event_attach_card.pb.h>
#include <libcockatrice/protocol/pb/event_change_zone_properties.pb.h>
#include <libcockatrice/protocol/pb/event_create_arrow.pb.h>
#include <libcockatrice/protocol/pb/event_create_token.pb.h>
#include <libcockatrice/protocol/pb/event_delete_arrow.pb.h>
#include <libcockatrice/protocol/pb/event_destroy_card.pb.h>
#include <libcockatrice/protocol/pb/event_dump_zone.pb.h>
#include <libcockatrice/protocol/pb/event_flip_card.pb.h>
#include <libcockatrice/protocol/pb/event_move_card.pb.h>
#include <libcockatrice/protocol/pb/event_player_properties_changed.pb.h>
#include <libcockatrice/protocol/pb/event_reveal_cards.pb.h>
#include <libcockatrice/protocol/pb/event_roll_die.pb.h>
#include <libcockatrice/protocol/pb/event_set_card_attr.pb.h>
#include <libcockatrice/protocol/pb/event_set_card_counter.pb.h>
#include <libcockatrice/protocol/pb/response.pb.h>
#include <libcockatrice/protocol/pb/response_dump_zone.pb.h>
#include <libcockatrice/protocol/pb/serverinfo_player.pb.h>
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
#include <libcockatrice/rng/rng_abstract.h>
#include <libcockatrice/utility/trice_limits.h>
Include dependency graph for server_abstract_player.cpp:

Functions

static Event_CreateToken makeCreateTokenEvent (Server_CardZone *zone, Server_Card *card, int xCoord, int yCoord, bool revealFacedownInfo=false)
static Event_AttachCard makeAttachCardEvent (Server_Card *attachedCard, Server_Card *parentCard=nullptr)
static bool shouldDestroyOnMove (const Server_Card *card, const Server_CardZone *startZone, const Server_CardZone *targetZone)

Function Documentation

◆ makeAttachCardEvent()

Event_AttachCard makeAttachCardEvent ( Server_Card * attachedCard,
Server_Card * parentCard = nullptr )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeCreateTokenEvent()

Event_CreateToken makeCreateTokenEvent ( Server_CardZone * zone,
Server_Card * card,
int xCoord,
int yCoord,
bool revealFacedownInfo = false )
static

Creates the create token event. By default, will set event's name and color fields to empty if the token is face-down

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

◆ shouldDestroyOnMove()

bool shouldDestroyOnMove ( const Server_Card * card,
const Server_CardZone * startZone,
const Server_CardZone * targetZone )
static

Determines whether moving the card from startZone to targetZone should cause the card to be destroyed.

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