9#include <QLoggingCategory>
12#include <QSharedPointer>
97 explicit CardInfo(
const QString &_name,
100 QVariantHash _properties,
101 const QList<CardRelation *> &_relatedCards,
102 const QList<CardRelation *> &_reverseRelatedCards,
130 static CardInfoPtr newInstance(
const QString &_name);
145 static CardInfoPtr newInstance(
const QString &_name,
146 const QString &_text,
148 QVariantHash _properties,
149 const QList<CardRelation *> &_relatedCards,
150 const QList<CardRelation *> &_reverseRelatedCards,
152 UiAttributes _uiAttributes);
164 newCardInfo->setSmartPointer(newCardInfo);
181 [[nodiscard]]
inline const QString &
getName()
const
210 [[nodiscard]] QString
getProperty(
const QString &propertyName)
const
212 return properties.value(propertyName).toString();
248 QList<CardRelation *> result;
253 void resetReverseRelatedCards2Me();
267 [[nodiscard]]
const QChar getColorChar()
const;
270 [[nodiscard]]
const QString getCardType()
const;
271 void setCardType(
const QString &value);
272 [[nodiscard]]
const QString getCmc()
const;
273 [[nodiscard]]
const QString getColors()
const;
274 void setColors(
const QString &value);
275 [[nodiscard]]
const QString getLoyalty()
const;
277 [[nodiscard]]
const QString getManaCost()
const;
278 [[nodiscard]]
const QString getPowTough()
const;
279 void setPowTough(
const QString &value);
289 [[nodiscard]] QString getCorrectedName()
const;
308 void combineLegalities(
const QVariantHash &props);
315 void refreshCachedSets();
325 static QString simplifyName(
const QString &name);
333 void refreshCachedSetNames();
340 void refreshCachedAltNames();
QSharedPointer< CardInfo > CardInfoPtr
Definition card_info.cpp:20
QMap< QString, QList< PrintingInfo > > SetToPrintingsMap
Definition card_info.h:25
QSharedPointer< CardSet > CardSetPtr
Definition card_info.h:24
QHash< QString, CardSetPtr > SetNameMap
Definition card_info.h:28
QSharedPointer< CardInfo > CardInfoPtr
Definition card_info.h:23
Q_LOGGING_CATEGORY(CardInfoLog, "card_info")
QHash< QString, CardInfoPtr > CardNameMap
Definition card_info.h:27
Represents a card and its associated metadata, properties, and relationships.
Definition card_info.h:46
bool hasProperty(const QString &propertyName) const
Definition card_info.h:219
QString simpleName
Simplified name for fuzzy matching.
Definition card_info.h:71
void setSmartPointer(CardInfoPtr _ptr)
Sets the internal smart pointer to self.
Definition card_info.h:175
const SetToPrintingsMap & getSets() const
Definition card_info.h:223
void setText(const QString &_text)
Definition card_info.h:197
UiAttributes uiAttributes
Attributes that affect display and game logic.
Definition card_info.h:79
const QList< CardRelation * > & getReverseRelatedCards() const
Definition card_info.h:238
const QString & getSimpleName() const
Definition card_info.h:185
const QList< CardRelation * > & getRelatedCards() const
Definition card_info.h:234
QList< CardRelation * > reverseRelatedCards
Cards that refer back to this card.
Definition card_info.h:76
const UiAttributes & getUiAttributes() const
Definition card_info.h:261
CardInfoPtr smartThis
Smart pointer to self for safe cross-references.
Definition card_info.h:69
const QList< CardRelation * > & getReverseRelatedCards2Me() const
Definition card_info.h:242
QSet< QString > altNames
Cached set of alternate names, used when searching.
Definition card_info.h:81
const QString & getSetsNames() const
Definition card_info.h:227
QString name
Full name of the card.
Definition card_info.h:70
QList< CardRelation * > relatedCards
Forward references to related cards.
Definition card_info.h:75
SetToPrintingsMap setsToPrintings
Mapping from set names to printing variations.
Definition card_info.h:78
void setProperty(const QString &_name, const QString &_value)
Definition card_info.h:214
QVariantHash properties
Key-value store of dynamic card properties.
Definition card_info.h:74
CardInfo(const QString &_name, const QString &_text, bool _isToken, QVariantHash _properties, const QList< CardRelation * > &_relatedCards, const QList< CardRelation * > &_reverseRelatedCards, SetToPrintingsMap _sets, UiAttributes _uiAttributes)
Constructs a CardInfo with full initialization.
Definition card_info.cpp:22
const QSet< QString > & getAltNames()
Definition card_info.h:189
QString getProperty(const QString &propertyName) const
Definition card_info.h:210
CardInfo(const CardInfo &other)
Copy constructor for CardInfo.
Definition card_info.h:113
QList< CardRelation * > reverseRelatedCardsToMe
Cards that consider this card as related.
Definition card_info.h:77
void addReverseRelatedCards2Me(CardRelation *cardRelation)
Definition card_info.h:254
CardInfoPtr clone() const
Clones the current CardInfo instance.
Definition card_info.h:161
void cardInfoChanged(CardInfoPtr card)
Emitted when card properties or state have changed.
const QString & getText() const
Definition card_info.h:193
QString setsNames
Cached, human-readable list of set names.
Definition card_info.h:80
bool getIsToken() const
Definition card_info.h:202
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:246
bool isToken
Whether this card is a token or not.
Definition card_info.h:73
QStringList getProperties() const
Definition card_info.h:206
QString text
Text description or rules text of the card.
Definition card_info.h:72
const QString & getName() const
Definition card_info.h:181
Represents a relationship between two cards.
Definition card_relation.h:24
A collection of cards grouped under a common identifier.
Definition card_set.h:35
Defines the base parser interface (ICardDatabaseParser) for all card database parsers.
Definition card_database_parser.h:20
Represents metadata for a specific variation of a card within a set.
Definition printing_info.h:27
static QString getMainCardType(const QStringList &typeList)
Definition oracleimporter.cpp:92
Attributes of the card that affect display and game logic.
Definition card_info.h:57
int tableRow
Row index in a table or visual representation.
Definition card_info.h:60
bool landscapeOrientation
Orientation flag for rendering.
Definition card_info.h:59
bool cipt
Positioning flag used by UI.
Definition card_info.h:58
bool upsideDownArt
Whether artwork is flipped for visual purposes.
Definition card_info.h:61