16#ifndef COCKATRICE_INNER_DECK_LIST_NODE_H
17#define COCKATRICE_INNER_DECK_LIST_NODE_H
22#define DECK_ZONE_MAIN "main"
24#define DECK_ZONE_SIDE "side"
26#define DECK_ZONE_TOKENS "tokens"
97 [[nodiscard]] QString
getName()
const override
172 const QString &_providerId =
"",
173 const QString &_cardNumber =
"");
179 [[nodiscard]]
int height()
const override;
187 [[nodiscard]]
int recursiveCount(
bool countTotalCards =
false)
const;
212 QVector<QPair<int, int>>
sort(Qt::SortOrder order = Qt::AscendingOrder);
Defines the AbstractDecklistNode base class used as the foundation for all nodes in the deck list tre...
Base class for all nodes in the deck list tree.
Definition abstract_deck_list_node.h:73
AbstractDecklistNode(InnerDecklistNode *_parent=nullptr, int position=-1)
Construct a new AbstractDecklistNode and insert it into its parent.
Definition abstract_deck_list_node.cpp:5
Represents a container node in the deck list hierarchy (zones and groupings).
Definition inner_deck_list_node.h:62
~InnerDecklistNode() override
Destructor. Recursively deletes all child nodes.
Definition inner_deck_list_node.cpp:18
static QString visibleNameFromName(const QString &_name)
Translate an internal name into a user-visible name.
Definition inner_deck_list_node.cpp:23
void clearTree()
Delete all children of this node, recursively.
Definition inner_deck_list_node.cpp:49
QString getCardCollectorNumber() const override
Definition inner_deck_list_node.h:138
bool compareNumber(AbstractDecklistNode *other) const
Compare this node against another for sorting.
Definition inner_deck_list_node.cpp:119
bool readElement(QXmlStreamReader *xml) override
Deserialize this node and its children from XML.
Definition inner_deck_list_node.cpp:141
int recursiveCount(bool countTotalCards=false) const
Count cards recursively under this node.
Definition inner_deck_list_node.cpp:90
AbstractDecklistNode * findCardChildByNameProviderIdAndNumber(const QString &_name, const QString &_providerId="", const QString &_cardNumber="")
Find a child card node by name, provider ID, and collector number.
Definition inner_deck_list_node.cpp:66
virtual QString getVisibleName() const
Get this node’s display-friendly name.
Definition inner_deck_list_node.cpp:44
bool compareName(AbstractDecklistNode *other) const
Compare this node against another for sorting.
Definition inner_deck_list_node.cpp:131
QString getCardProviderId() const override
Definition inner_deck_list_node.h:126
void writeElement(QXmlStreamWriter *xml) override
Serialize this node and its children to XML.
Definition inner_deck_list_node.cpp:163
QString getCardSetShortName() const override
Definition inner_deck_list_node.h:132
void setName(const QString &_name)
Definition inner_deck_list_node.h:103
bool isDeckHeader() const override
Definition inner_deck_list_node.h:144
int height() const override
Compute the height of this node.
Definition inner_deck_list_node.cpp:85
QString name
Internal identifier for this node (zone or group name).
Definition inner_deck_list_node.h:63
InnerDecklistNode(QString _name=QString(), InnerDecklistNode *_parent=nullptr, int position=-1)
Construct a new InnerDecklistNode.
Definition inner_deck_list_node.h:73
QString getName() const override
Definition inner_deck_list_node.h:97
QVector< QPair< int, int > > sort(Qt::SortOrder order=Qt::AscendingOrder)
Sort this node’s children recursively.
Definition inner_deck_list_node.cpp:172
bool compare(AbstractDecklistNode *other) const override
Compare this node against another for sorting.
Definition inner_deck_list_node.cpp:107
AbstractDecklistNode * findChild(const QString &_name)
Find a direct child node by name.
Definition inner_deck_list_node.cpp:56
void setSortMethod(DeckSortMethod method) override
Set the sorting method for this node and all children.
Definition inner_deck_list_node.cpp:36
DeckSortMethod
Defines the different sort strategies a node may use to order its children.
Definition abstract_deck_list_node.h:36