12#include <QLoggingCategory>
17#include <QSharedPointer>
20#include <qtmetamacros.h>
112 explicit CardInfo(
const QString &_name,
113 const QString &_text,
146 explicit CardInfo(
const QString &_name,
147 const QString &_text,
149 const QByteArray &_propertiesBlob,
153 UiAttributes _uiAttributes,
184 static CardInfoPtr newInstance(
const QString &_name);
201 static CardInfoPtr newInstance(
const QString &_name,
202 const QString &_text,
208 UiAttributes _uiAttributes,
234 static CardInfoPtr newInstance(
const QString &_name,
235 const QString &_text,
237 QByteArray _propertiesBlob,
241 UiAttributes _uiAttributes,
244 bool _appendToSets =
true,
258 newCardInfo->setSmartPointer(newCardInfo);
275 [[nodiscard]]
inline const QString &
getName()
const
383 languages.removeDuplicates();
396 [[nodiscard]] QString
getProperty(
const QString &propertyName)
const
400 void setProperty(
const QString &_name,
const QString &_value);
435 void resetReverseRelatedCards2Me();
449 [[nodiscard]] QChar getColorChar()
const;
452 [[nodiscard]] QString getCardType()
const;
453 void setCardType(
const QString &value);
454 [[nodiscard]] QString getCmc()
const;
455 [[nodiscard]] QString getColors()
const;
456 void setColors(
const QString &value);
457 [[nodiscard]] QString getLoyalty()
const;
458 [[nodiscard]] QString getMainCardType()
const;
459 [[nodiscard]] QString getManaCost()
const;
460 [[nodiscard]] QString getPowTough()
const;
461 void setPowTough(
const QString &value);
471 [[nodiscard]] QString getCorrectedName()
const;
479 [[nodiscard]] QString getLegalityProp(
const QString &format)
const;
488 [[nodiscard]]
bool isLegalInFormat(
const QString &format)
const;
514 void refreshCachedSets();
524 static QString simplifyName(
const QString &name);
532 void refreshCachedSetNames();
539 void refreshCachedAltNames();
QSharedPointer< CardInfo > CardInfoPtr
Definition card_info.cpp:15
QMap< QString, QList< PrintingInfo > > SetToPrintingsMap
Definition card_info.h:32
QHash< QString, FormatRulesPtr > FormatRulesNameMap
Definition card_info.h:36
QSharedPointer< FormatRules > FormatRulesPtr
Definition card_info.h:31
QSharedPointer< CardSet > CardSetPtr
Definition card_info.h:30
QHash< QString, CardSetPtr > SetNameMap
Definition card_info.h:35
QSharedPointer< CardInfo > CardInfoPtr
Definition card_info.h:29
QHash< QString, CardInfoPtr > CardNameMap
Definition card_info.h:34
Represents a card and its associated metadata, properties, and relationships.
Definition card_info.h:54
bool hasProperty(const QString &propertyName) const
Definition card_info.h:401
const QString & getLocalizedText(const QString &lang) const
Returns the rules text in the given language, falling back to the English text when no localization i...
Definition card_info.h:317
void setLocalizedName(const QString &lang, const QString &_localizedName)
Sets the card name for the given language.
Definition card_info.h:351
const QMap< QString, QString > & getLocalizedTexts() const
Returns the localized rules text keyed by language code.
Definition card_info.h:340
QString simpleName
Simplified name for fuzzy matching.
Definition card_info.h:79
void setSmartPointer(CardInfoPtr _ptr)
Sets the internal smart pointer to self.
Definition card_info.h:269
const SetToPrintingsMap & getSets() const
Definition card_info.h:405
void setText(const QString &_text)
Definition card_info.h:291
QMap< QString, QString > localizedTexts
Localized rules text, keyed by language code.
Definition card_info.h:84
const QMap< QString, QString > & getLocalizedNames() const
Returns the localized card names keyed by language code.
Definition card_info.h:329
UiAttributes uiAttributes
Attributes that affect display and game logic.
Definition card_info.h:92
const QList< CardRelation * > & getReverseRelatedCards() const
Definition card_info.h:420
const QString & getSimpleName() const
Definition card_info.h:279
const QList< CardRelation * > & getRelatedCards() const
Definition card_info.h:416
QList< CardRelation * > reverseRelatedCards
Cards that refer back to this card.
Definition card_info.h:89
const UiAttributes & getUiAttributes() const
Definition card_info.h:443
CardInfoPtr smartThis
Smart pointer to self for safe cross-references.
Definition card_info.h:77
QMap< QString, QString > localizedNames
Localized card names, keyed by language code.
Definition card_info.h:83
const QList< CardRelation * > & getReverseRelatedCards2Me() const
Definition card_info.h:424
QSet< QString > altNames
Cached set of alternate names, used when searching.
Definition card_info.h:94
const QString & getSetsNames() const
Definition card_info.h:409
QString name
Full name of the card.
Definition card_info.h:78
QList< CardRelation * > relatedCards
Forward references to related cards.
Definition card_info.h:88
SetToPrintingsMap setsToPrintings
Mapping from set names to printing variations.
Definition card_info.h:91
void setLocalizedText(const QString &lang, const QString &_localizedText)
Sets the rules text for the given language.
Definition card_info.h:366
const QSet< QString > & getAltNames()
Definition card_info.h:283
QString getProperty(const QString &propertyName) const
Definition card_info.h:396
CardInfo(const CardInfo &other)
Copy constructor for CardInfo.
Definition card_info.h:166
LazyPropertiesHash properties
Key-value store of dynamic card properties.
Definition card_info.h:86
QList< CardRelation * > reverseRelatedCardsToMe
Cards that consider this card as related.
Definition card_info.h:90
void addReverseRelatedCards2Me(CardRelation *cardRelation)
Definition card_info.h:436
CardInfoPtr clone() const
Clones the current CardInfo instance.
Definition card_info.h:255
void cardInfoChanged(CardInfoPtr card)
Emitted when card properties or state have changed.
const QString & getText() const
Definition card_info.h:287
QString setsNames
Cached, human-readable list of set names.
Definition card_info.h:93
bool getIsToken() const
Definition card_info.h:386
const QString & getLocalizedName(const QString &lang) const
Returns the card name in the given language, falling back to the English name when no localization is...
Definition card_info.h:304
CardInfo(const QString &_name, const QString &_text, bool _isToken, const QHash< QString, QString > &_properties, const QList< CardRelation * > &_relatedCards, const QList< CardRelation * > &_reverseRelatedCards, SetToPrintingsMap _sets, UiAttributes _uiAttributes, QMap< QString, QString > _localizedNames={}, QMap< QString, QString > _localizedTexts={})
Constructs a CardInfo with full initialization.
Definition card_info.cpp:32
const QHash< QString, QString > & getPropertiesHash() const
Definition card_info.cpp:17
void pixmapUpdated(const PrintingInfo &printing)
Emitted when a pixmap for this card has been updated or finished loading.
QList< CardRelation * > getAllRelatedCards() const
Definition card_info.h:428
bool isToken
Whether this card is a token or not.
Definition card_info.h:81
QStringList getProperties() const
Definition card_info.h:390
QString text
Text description or rules text of the card.
Definition card_info.h:80
QStringList localizationLanguages() const
Returns the language codes for which this card has a localized name or rules text.
Definition card_info.h:379
const QString & getName() const
Definition card_info.h:275
Represents a relationship between two cards.
Definition card_relation.h:25
A collection of cards grouped under a common identifier.
Definition card_set.h:37
A property map that can lazily deserialize blobs to avoid loading overhead.
Definition lazy_properties_hash.h:19
Represents metadata for a specific variation of a card within a set.
Definition printing_info.h:31
PrintingInfo(const CardSetPtr &_set=nullptr, const LazyPropertiesHash &_properties={})
Constructs a PrintingInfo associated with a specific set.
Definition printing_info.cpp:5
Definition mana_curve_category_widget.h:11
Definition remote_connection_controller.h:20
Definition dlg_manage_sets.h:29
Definition arrow_registry.h:10
Q_LOGGING_CATEGORY(CrashReportLog, "crash_report")
Attributes of the card that affect display and game logic.
Definition card_info.h:65
int tableRow
Row index in a table or visual representation.
Definition card_info.h:68
bool landscapeOrientation
Orientation flag for rendering.
Definition card_info.h:67
bool cipt
Positioning flag used by UI.
Definition card_info.h:66
bool upsideDownArt
Whether artwork is flipped for visual purposes.
Definition card_info.h:69