Represents a container node in the deck list hierarchy (zones and groupings).
More...
|
| | InnerDecklistNode (QString _name=QString(), InnerDecklistNode *_parent=nullptr, int position=-1) |
| | Construct a new InnerDecklistNode.
|
| | InnerDecklistNode (InnerDecklistNode *other, InnerDecklistNode *_parent=nullptr) |
| | Copy constructor with parent reassignment.
|
| | ~InnerDecklistNode () override |
| | Destructor. Recursively deletes all child nodes.
|
| void | setSortMethod (DeckSortMethod method) override |
| | Set the sorting method for this node and all children.
|
| QString | getName () const override |
| void | setName (const QString &_name) |
| virtual QString | getVisibleName () const |
| | Get this node’s display-friendly name.
|
| QString | getCardProviderId () const override |
| QString | getCardSetShortName () const override |
| QString | getCardCollectorNumber () const override |
| bool | isDeckHeader () const override |
| void | clearTree () |
| | Delete all children of this node, recursively.
|
| AbstractDecklistNode * | findChild (const QString &_name) |
| | Find a direct child node by name.
|
| AbstractDecklistNode * | findCardChildByNameProviderIdAndNumber (const QString &_name, const QString &_providerId="", const QString &_cardNumber="") |
| | Find a child card node by name, provider ID, and collector number.
|
| int | height () const override |
| | Compute the height of this node.
|
| int | recursiveCount (bool countTotalCards=false) const |
| | Count cards recursively under this node.
|
| bool | compare (AbstractDecklistNode *other) const override |
| | Compare this node against another for sorting.
|
| bool | compareNumber (AbstractDecklistNode *other) const |
| | Compare this node against another for sorting.
|
| bool | compareName (AbstractDecklistNode *other) const |
| | Compare this node against another for sorting.
|
| QVector< QPair< int, int > > | sort (Qt::SortOrder order=Qt::AscendingOrder) |
| | Sort this node’s children recursively.
|
| bool | readElement (QXmlStreamReader *xml) override |
| | Deserialize this node and its children from XML.
|
| void | writeElement (QXmlStreamWriter *xml) override |
| | Serialize this node and its children to XML.
|
| | AbstractDecklistNode (InnerDecklistNode *_parent=nullptr, int position=-1) |
| | Construct a new AbstractDecklistNode and insert it into its parent.
|
| virtual | ~AbstractDecklistNode ()=default |
| | Virtual destructor. Child classes must clean up their resources.
|
| InnerDecklistNode * | getParent () const |
| int | depth () const |
| | Compute the depth of this node in the tree.
|
Represents a container node in the deck list hierarchy (zones and groupings).
Unlike DecklistCardNode, which holds leaf card data, this class manages collections of child nodes, which may themselves be InnerDecklistNode or DecklistCardNode objects.
Role in the hierarchy:
- Root node (invisible): Holds zones.
- Zone nodes: "main", "side", "tokens".
- Grouping nodes: Created dynamically when grouping by type, color, or mana cost.
- Card nodes: Always children of an InnerDecklistNode.
Design notes:
- Inherits from AbstractDecklistNode (tree interface) and QList<AbstractDecklistNode*> (storage of children). This allows direct QList-style manipulation of children while still presenting a polymorphic node interface.
Responsibilities:
- Store a display name.
- Own and manage child nodes (insert, clear, find).
- Provide recursive operations such as counting cards or computing height.
- Implement sorting logic for reordering children.
- Implement XML serialization for persistence.
Ownership:
- Owns all child nodes stored in the QList. The destructor recursively deletes children.