Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
printing_info.h
Go to the documentation of this file.
1#ifndef COCKATRICE_PRINTING_INFO_H
2#define COCKATRICE_PRINTING_INFO_H
3
4#include "../set/card_set.h"
5
6#include <QList>
7#include <QMap>
8#include <QVariant>
9
10class PrintingInfo;
11
12using SetToPrintingsMap = QMap<QString, QList<PrintingInfo>>;
13
27{
28public:
34 explicit PrintingInfo(const CardSetPtr &_set = nullptr);
35
41 ~PrintingInfo() = default;
42
52 bool operator==(const PrintingInfo &other) const
53 {
54 return this->set == other.set && this->properties == other.properties;
55 }
56
57private:
59 QVariantHash properties;
60
61public:
67 [[nodiscard]] CardSetPtr getSet() const
68 {
69 return set;
70 }
71
77 [[nodiscard]] QStringList getProperties() const
78 {
79 return properties.keys();
80 }
81
88 [[nodiscard]] QString getProperty(const QString &propertyName) const
89 {
90 return properties.value(propertyName).toString();
91 }
92
101 void setProperty(const QString &_name, const QString &_value)
102 {
103 properties.insert(_name, _value);
104 }
105
111 [[nodiscard]] QString getUuid() const;
112
118 [[nodiscard]] QString getFlavorName() const;
119};
120
121#endif // COCKATRICE_PRINTING_INFO_H
QMap< QString, QList< PrintingInfo > > SetToPrintingsMap
Definition card_info.h:25
QSharedPointer< CardSet > CardSetPtr
Definition card_info.h:24
Represents metadata for a specific variation of a card within a set.
Definition printing_info.h:27
CardSetPtr getSet() const
Returns the set this printing belongs to.
Definition printing_info.h:67
QString getFlavorName() const
Returns the flavorName for this printing.
Definition printing_info.cpp:17
bool operator==(const PrintingInfo &other) const
Equality operator.
Definition printing_info.h:52
QString getProperty(const QString &propertyName) const
Retrieves the value of a specific property.
Definition printing_info.h:88
void setProperty(const QString &_name, const QString &_value)
Sets or updates the value of a specific property.
Definition printing_info.h:101
PrintingInfo(const CardSetPtr &_set=nullptr)
Constructs a PrintingInfo associated with a specific set.
Definition printing_info.cpp:5
QString getUuid() const
Returns the providerID for this printing.
Definition printing_info.cpp:12
QStringList getProperties() const
Returns the list of property names defined for this printing.
Definition printing_info.h:77
~PrintingInfo()=default
Destroys the PrintingInfo.
CardSetPtr set
The set this variation belongs to.
Definition printing_info.h:58
QVariantHash properties
Key-value store for variation-specific attributes.
Definition printing_info.h:59