#include <deck_list_node_tree.h>
|
| | DecklistNodeTree () |
| | Constructs an empty DecklistNodeTree.
|
| | DecklistNodeTree (const DecklistNodeTree &other) |
| | Copy constructor. Deep copies the tree.
|
| DecklistNodeTree & | operator= (const DecklistNodeTree &other) |
| | Copy-assignment operator. Deep copies the tree.
|
| virtual | ~DecklistNodeTree () |
| InnerDecklistNode * | getRoot () const |
| | Gets a pointer to the underlying root node. Note: DO NOT call this method unless the object needs to have access to the underlying model. For now, only the DeckListModel should be calling this.
|
| bool | isEmpty () const |
| void | clear () |
| | Deletes all nodes except the root.
|
| QList< const DecklistCardNode * > | getCardNodes (const QSet< QString > &restrictToZones={}) const |
| QList< const InnerDecklistNode * > | getZoneNodes () const |
| QString | computeDeckHash () const |
| | Computes the deck hash.
|
| void | write (QXmlStreamWriter *xml) const |
| | Writes the contents of the deck to xml.
|
| void | readZoneElement (QXmlStreamReader *xml) |
| | Reads a "zone" section of the xml to this tree.
|
| DecklistCardNode * | addCard (const QString &cardName, int amount, const QString &zoneName, int position, const QString &cardSetName=QString(), const QString &cardSetCollectorNumber=QString(), const QString &cardProviderId=QString(), const bool formatLegal=true) |
| bool | deleteNode (AbstractDecklistNode *node, InnerDecklistNode *rootNode=nullptr) |
| void | forEachCard (const std::function< void(InnerDecklistNode *, DecklistCardNode *)> &func) const |
| | Apply a function to every card in the deck tree. This can modify the cards.
|
◆ DecklistNodeTree() [1/2]
| DecklistNodeTree::DecklistNodeTree |
( |
| ) |
|
|
explicit |
◆ DecklistNodeTree() [2/2]
Copy constructor. Deep copies the tree.
◆ ~DecklistNodeTree()
| DecklistNodeTree::~DecklistNodeTree |
( |
| ) |
|
|
virtual |
◆ addCard()
| DecklistCardNode * DecklistNodeTree::addCard |
( |
const QString & | cardName, |
|
|
int | amount, |
|
|
const QString & | zoneName, |
|
|
int | position, |
|
|
const QString & | cardSetName = QString(), |
|
|
const QString & | cardSetCollectorNumber = QString(), |
|
|
const QString & | cardProviderId = QString(), |
|
|
const bool | formatLegal = true ) |
◆ clear()
| void DecklistNodeTree::clear |
( |
| ) |
|
Deletes all nodes except the root.
◆ computeDeckHash()
| QString DecklistNodeTree::computeDeckHash |
( |
| ) |
const |
◆ deleteNode()
◆ forEachCard()
Apply a function to every card in the deck tree. This can modify the cards.
- Parameters
-
| func | Function taking (zone node, card node). |
◆ getCardNodes()
| QList< const DecklistCardNode * > DecklistNodeTree::getCardNodes |
( |
const QSet< QString > & | restrictToZones = {} | ) |
const |
Gets all card nodes in the tree
- Parameters
-
| restrictToZones | Only get the nodes in these zones |
- Returns
- A QList containing all the card nodes in the zone.
◆ getRoot()
Gets a pointer to the underlying root node. Note: DO NOT call this method unless the object needs to have access to the underlying model. For now, only the DeckListModel should be calling this.
◆ getZoneNodes()
◆ getZoneObjFromName()
| InnerDecklistNode * DecklistNodeTree::getZoneObjFromName |
( |
const QString & | zoneName | ) |
const |
|
private |
Gets the InnerDecklistNode that is the root node for the given zone, creating a new node if it doesn't exist.
◆ isEmpty()
| bool DecklistNodeTree::isEmpty |
( |
| ) |
const |
◆ operator=()
Copy-assignment operator. Deep copies the tree.
◆ readZoneElement()
| void DecklistNodeTree::readZoneElement |
( |
QXmlStreamReader * | xml | ) |
|
Reads a "zone" section of the xml to this tree.
◆ write()
| void DecklistNodeTree::write |
( |
QXmlStreamWriter * | xml | ) |
const |
Writes the contents of the deck to xml.
◆ root
Root of the deck tree (zones + cards).
The documentation for this class was generated from the following files: