17#ifndef COCKATRICE_ABSTRACT_DECK_LIST_NODE_H
18#define COCKATRICE_ABSTRACT_DECK_LIST_NODE_H
20#include <QtCore/QXmlStreamWriter>
125 [[nodiscard]]
virtual QString
getName()
const = 0;
149 [[nodiscard]]
int depth()
const;
161 [[nodiscard]]
virtual int height()
const = 0;
@ ByNumber
Sort by numeric properties (e.g. collector number).
Definition abstract_deck_list_node.h:37
@ Default
Leave in insertion order.
Definition abstract_deck_list_node.h:39
@ ByName
Sort by card name (locale-aware comparison).
Definition abstract_deck_list_node.h:38
InnerDecklistNode * getParent() const
Definition abstract_deck_list_node.h:140
virtual QString getCardSetShortName() const =0
virtual ~AbstractDecklistNode()=default
Virtual destructor. Child classes must clean up their resources.
virtual bool compare(AbstractDecklistNode *other) const =0
Compare this node against another for sorting.
InnerDecklistNode * parent
Pointer to the parent node, or nullptr if this is the root.
Definition abstract_deck_list_node.h:81
virtual void setSortMethod(DeckSortMethod method)
Set the sort method for this node’s children.
Definition abstract_deck_list_node.h:113
AbstractDecklistNode(InnerDecklistNode *_parent=nullptr, int position=-1)
Construct a new AbstractDecklistNode and insert it into its parent.
Definition abstract_deck_list_node.cpp:5
int depth() const
Compute the depth of this node in the tree.
Definition abstract_deck_list_node.cpp:17
DeckSortMethod sortMethod
Current sorting strategy for this node's children.
Definition abstract_deck_list_node.h:89
virtual bool isDeckHeader() const =0
Whether this node is the "deck header" (deck metadata).
virtual QString getName() const =0
virtual void writeElement(QXmlStreamWriter *xml)=0
virtual bool readElement(QXmlStreamReader *xml)=0
virtual QString getCardCollectorNumber() const =0
virtual int height() const =0
Compute the "height" of this node.
virtual QString getCardProviderId() const =0
Represents a container node in the deck list hierarchy (zones and groupings).
Definition inner_deck_list_node.h:62
DeckSortMethod
Defines the different sort strategies a node may use to order its children.
Definition abstract_deck_list_node.h:36