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

Represents metadata for a specific variation of a card within a set. More...

#include <printing_info.h>

Public Member Functions

 PrintingInfo (const CardSetPtr &_set=nullptr)
 Constructs a PrintingInfo associated with a specific set.
 ~PrintingInfo ()=default
 Destroys the PrintingInfo.
bool operator== (const PrintingInfo &other) const
 Equality operator.
CardSetPtr getSet () const
 Returns the set this printing belongs to.
QStringList getProperties () const
 Returns the list of property names defined for this printing.
QString getProperty (const QString &propertyName) const
 Retrieves the value of a specific property.
void setProperty (const QString &_name, const QString &_value)
 Sets or updates the value of a specific property.
QString getUuid () const
 Returns the providerID for this printing.
QString getFlavorName () const
 Returns the flavorName for this printing.

Private Attributes

CardSetPtr set
 The set this variation belongs to.
QVariantHash properties
 Key-value store for variation-specific attributes.

Detailed Description

Represents metadata for a specific variation of a card within a set.

A card can have multiple variations across sets. PrintingInfo associates a card with one such variation, and provides per-printing attributes such as identifiers or additional properties.

Equality is defined as both the set and the property values being equal.

Constructor & Destructor Documentation

◆ PrintingInfo()

PrintingInfo::PrintingInfo ( const CardSetPtr & _set = nullptr)
explicit

Constructs a PrintingInfo associated with a specific set.

Parameters
_setThe set this printing belongs to (defaults to null).
Here is the caller graph for this function:

◆ ~PrintingInfo()

PrintingInfo::~PrintingInfo ( )
default

Destroys the PrintingInfo.

Defaulted since no special cleanup is required.

Member Function Documentation

◆ getFlavorName()

QString PrintingInfo::getFlavorName ( ) const
nodiscard

Returns the flavorName for this printing.

Returns
The flavorName, or empty if it isn't present.

◆ getProperties()

QStringList PrintingInfo::getProperties ( ) const
inlinenodiscard

Returns the list of property names defined for this printing.

Returns
List of keys stored in the properties map.

◆ getProperty()

QString PrintingInfo::getProperty ( const QString & propertyName) const
inlinenodiscard

Retrieves the value of a specific property.

Parameters
propertyNameThe key name of the property to query.
Returns
The property value as a string, or an empty string if not set.
Here is the caller graph for this function:

◆ getSet()

CardSetPtr PrintingInfo::getSet ( ) const
inlinenodiscard

Returns the set this printing belongs to.

Returns
Pointer to the associated CardSet.
Here is the caller graph for this function:

◆ getUuid()

QString PrintingInfo::getUuid ( ) const
nodiscard

Returns the providerID for this printing.

Returns
A string representing the providerID.

Gets the uuid property of the printing, or an empty string if the property isn't present

Here is the caller graph for this function:

◆ operator==()

bool PrintingInfo::operator== ( const PrintingInfo & other) const
inline

Equality operator.

Two PrintingInfo objects are equal if they refer to the same set and contain the exact same property key/value pairs.

Parameters
otherAnother PrintingInfo to compare against.
Returns
True if both set and properties are equal, otherwise false.
Here is the call graph for this function:

◆ setProperty()

void PrintingInfo::setProperty ( const QString & _name,
const QString & _value )
inline

Sets or updates the value of a specific property.

If the property already exists, its value is replaced.

Parameters
_nameThe name of the property.
_valueThe string value to assign.
Here is the caller graph for this function:

Member Data Documentation

◆ properties

QVariantHash PrintingInfo::properties
private

Key-value store for variation-specific attributes.

◆ set

CardSetPtr PrintingInfo::set
private

The set this variation belongs to.


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