Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
deck_list.cpp File Reference
#include "deck_list.h"
#include "deck_list_memento.h"
#include "deck_list_plain_text_parser.h"
#include "libcockatrice/deck_list/deck_list_node_tree.h"
#include "libcockatrice/deck_list/sideboard_plan.h"
#include "libcockatrice/utility/playmat_params.h"
#include "tree/deck_list_card_node.h"
#include "tree/inner_deck_list_node.h"
#include <QAnyStringView>
#include <QDebug>
#include <QSet>
#include <QSharedPointer>
#include <QStringView>
#include <QTextStream>
#include <QXmlStreamAttributes>
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include <QtGlobal>
#include <algorithm>
#include <iterator>
#include <libcockatrice/utility/card_ref.h>
#include <qlogging.h>
Include dependency graph for deck_list.cpp:

Functions

static double parseClampedParam (const QString &valueString, double fallback, double min, double max)
 Parses a floating point XML attribute into a clamped playmat parameter.
static CardRef readBannerCard (QXmlStreamReader *xml)
 Reads a bannerCard element from the XML stream.
static PlaymatInfo readPlaymatCard (QXmlStreamReader *xml)
 Reads a playmatCard element from the XML stream.

Variables

static const QString CURRENT_SIDEBOARD_PLAN_KEY = ""

Function Documentation

◆ parseClampedParam()

double parseClampedParam ( const QString & valueString,
double fallback,
double min,
double max )
static

Parses a floating point XML attribute into a clamped playmat parameter.

Falls back to fallback when the attribute is missing or malformed, so malformed deck files cannot produce degenerate art rectangles (e.g. a zoom of 0 dividing by zero).

Parameters
valueStringRaw attribute text.
fallbackValue used when the text cannot be parsed.
minLower clamp bound.
maxUpper clamp bound.
Returns
The parsed value clamped to [min, max], or fallback.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBannerCard()

CardRef readBannerCard ( QXmlStreamReader * xml)
static

Reads a bannerCard element from the XML stream.

Parameters
xmlReader positioned at the element.
Returns
The referenced card.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readPlaymatCard()

PlaymatInfo readPlaymatCard ( QXmlStreamReader * xml)
static

Reads a playmatCard element from the XML stream.

Attribute values are read before readElementText consumes the element, and the params are clamped to the same ranges as the settings dialog and the remote player-properties path so malformed deck files cannot produce degenerate art rectangles (e.g. a zoom of 0 dividing by zero).

Parameters
xmlReader positioned at the element.
Returns
The referenced card plus its clamped positioning parameters.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ CURRENT_SIDEBOARD_PLAN_KEY

const QString CURRENT_SIDEBOARD_PLAN_KEY = ""
static