Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
exact_card.h
Go to the documentation of this file.
1#ifndef EXACT_CARD_H
2#define EXACT_CARD_H
3
4#include "../card_info.h"
6
7#include <QByteArray>
8#include <QMetaType>
9#include <QString>
10
24{
27
28public:
35 ExactCard();
36
43 explicit ExactCard(const CardInfoPtr &_card, const PrintingInfo &_printing = PrintingInfo());
44
50 [[nodiscard]] CardInfoPtr getCardPtr() const
51 {
52 return card;
53 }
54
60 [[nodiscard]] PrintingInfo getPrinting() const
61 {
62 return printing;
63 }
64
71 bool operator==(const ExactCard &other) const;
72
78 [[nodiscard]] QString getName() const;
79
89 [[nodiscard]] const CardInfo &getInfo() const;
90
97 [[nodiscard]] QString getPixmapCacheKey() const;
98
105 [[nodiscard]] bool isEmpty() const;
106
112 explicit operator bool() const;
113
120 void emitPixmapUpdated() const;
121};
122Q_DECLARE_METATYPE(ExactCard)
123
124#endif // EXACT_CARD_H
QSharedPointer< CardInfo > CardInfoPtr
Definition card_info.cpp:15
Represents a card and its associated metadata, properties, and relationships.
Definition card_info.h:54
Represents a specific card instance, defined by its CardInfo and a particular printing.
Definition exact_card.h:24
bool operator==(const ExactCard &other) const
Compares both card pointer and printing for equality.
Definition exact_card.cpp:27
QString getPixmapCacheKey() const
Generates a stable cache key for pixmap caching.
Definition exact_card.cpp:57
const CardInfo & getInfo() const
Returns a reference to the underlying CardInfo object.
Definition exact_card.cpp:45
CardInfoPtr getCardPtr() const
Returns the underlying CardInfoPtr.
Definition exact_card.h:50
QString getName() const
Convenience helper to get the card's display name.
Definition exact_card.cpp:36
PrintingInfo printing
Definition exact_card.h:26
void emitPixmapUpdated() const
Emits the pixmapUpdated signal on the underlying CardInfo.
Definition exact_card.cpp:83
PrintingInfo getPrinting() const
Returns the printing information associated with this card.
Definition exact_card.h:60
CardInfoPtr card
Definition exact_card.h:25
ExactCard()
Constructs an empty ExactCard.
Definition exact_card.cpp:15
bool isEmpty() const
Indicates whether this ExactCard represents no valid card.
Definition exact_card.cpp:67
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