Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
deck_list_card_node.h
Go to the documentation of this file.
1
11
12#ifndef COCKATRICE_DECK_LIST_CARD_NODE_H
13#define COCKATRICE_DECK_LIST_CARD_NODE_H
14
16
17#include <QString>
19#include <utility>
20
22
52{
53 QString name;
54 int number;
56 QString cardSetNumber;
59
60public:
76 explicit DecklistCardNode(QString _name = QString(),
77 int _number = 1,
78 InnerDecklistNode *_parent = nullptr,
79 int position = -1,
80 QString _cardSetShortName = QString(),
81 QString _cardSetNumber = QString(),
82 QString _cardProviderId = QString(),
83 bool _formatLegality = true)
84 : AbstractDecklistCardNode(_parent, position), name(std::move(_name)), number(_number),
85 cardSetShortName(std::move(_cardSetShortName)), cardSetNumber(std::move(_cardSetNumber)),
86 cardProviderId(std::move(_cardProviderId)), formatLegal(_formatLegality)
87 {
88 }
89
98 explicit DecklistCardNode(DecklistCardNode *other, InnerDecklistNode *_parent);
99
101 [[nodiscard]] int getNumber() const override
102 {
103 return number;
104 }
105
107 void setNumber(int _number) override
108 {
109 number = _number;
110 }
111
113 [[nodiscard]] QString getName() const override
114 {
115 return name;
116 }
117
119 void setName(const QString &_name) override
120 {
121 name = _name;
122 }
123
125 [[nodiscard]] QString getCardProviderId() const override
126 {
127 return cardProviderId;
128 }
129
131 void setCardProviderId(const QString &_providerId) override
132 {
133 cardProviderId = _providerId;
134 }
135
137 [[nodiscard]] QString getCardSetShortName() const override
138 {
139 return cardSetShortName;
140 }
141
143 void setCardSetShortName(const QString &_cardSetShortName) override
144 {
145 cardSetShortName = _cardSetShortName;
146 }
147
149 [[nodiscard]] QString getCardCollectorNumber() const override
150 {
151 return cardSetNumber;
152 }
153
155 void setCardCollectorNumber(const QString &_cardSetNumber) override
156 {
157 cardSetNumber = _cardSetNumber;
158 }
159
161 [[nodiscard]] bool getFormatLegality() const override
162 {
163 return formatLegal;
164 }
165
167 void setFormatLegality(const bool _formatLegal) override
168 {
169 formatLegal = _formatLegal;
170 }
171
173 [[nodiscard]] bool isDeckHeader() const override
174 {
175 return false;
176 }
177
184 [[nodiscard]] CardRef toCardRef() const
185 {
186 return {name, cardProviderId};
187 }
188};
189
190#endif // COCKATRICE_DECK_LIST_CARD_NODE_H
Defines the AbstractDecklistCardNode base class, which adds card-specific behavior on top of Abstract...
AbstractDecklistCardNode(InnerDecklistNode *_parent=nullptr, int position=-1)
Construct a new AbstractDecklistCardNode.
Definition abstract_deck_list_card_node.h:60
Concrete node type representing an actual card entry in the deck.
Definition deck_list_card_node.h:52
CardRef toCardRef() const
Convert this node to a CardRef.
Definition deck_list_card_node.h:184
bool formatLegal
Format legality.
Definition deck_list_card_node.h:58
int number
Quantity of this card in the deck.
Definition deck_list_card_node.h:54
QString name
Display name of the card.
Definition deck_list_card_node.h:53
void setNumber(int _number) override
Definition deck_list_card_node.h:107
QString getCardProviderId() const override
Definition deck_list_card_node.h:125
void setCardCollectorNumber(const QString &_cardSetNumber) override
Definition deck_list_card_node.h:155
QString cardSetShortName
Short set code (e.g., "NEO").
Definition deck_list_card_node.h:55
DecklistCardNode(QString _name=QString(), int _number=1, InnerDecklistNode *_parent=nullptr, int position=-1, QString _cardSetShortName=QString(), QString _cardSetNumber=QString(), QString _cardProviderId=QString(), bool _formatLegality=true)
Construct a new DecklistCardNode.
Definition deck_list_card_node.h:76
QString getCardSetShortName() const override
Definition deck_list_card_node.h:137
void setCardProviderId(const QString &_providerId) override
Definition deck_list_card_node.h:131
QString getCardCollectorNumber() const override
Definition deck_list_card_node.h:149
void setFormatLegality(const bool _formatLegal) override
Definition deck_list_card_node.h:167
QString cardSetNumber
Collector number within the set.
Definition deck_list_card_node.h:56
QString getName() const override
Definition deck_list_card_node.h:113
QString cardProviderId
External provider identifier (e.g., UUID).
Definition deck_list_card_node.h:57
void setCardSetShortName(const QString &_cardSetShortName) override
Definition deck_list_card_node.h:143
bool isDeckHeader() const override
Definition deck_list_card_node.h:173
int getNumber() const override
Definition deck_list_card_node.h:101
bool getFormatLegality() const override
Definition deck_list_card_node.h:161
void setName(const QString &_name) override
Definition deck_list_card_node.h:119
Represents a container node in the deck list hierarchy (zones and groupings).
Definition inner_deck_list_node.h:73
Definition card_ref.h:14