Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
DecklistModelCardNode Class Reference

Adapter node that wraps a DecklistCardNode for use in the DeckListModel tree. More...

#include <deck_list_model.h>

Inheritance diagram for DecklistModelCardNode:
[legend]
Collaboration diagram for DecklistModelCardNode:
[legend]

Public Member Functions

 DecklistModelCardNode (DecklistCardNode *_dataNode, InnerDecklistNode *_parent, int position=-1)
 Constructs a model node wrapping a DecklistCardNode.
int getNumber () const override
void setNumber (int _number) override
QString getName () const override
void setName (const QString &_name) override
QString getCardProviderId () const override
void setCardProviderId (const QString &_cardProviderId) override
QString getCardSetShortName () const override
void setCardSetShortName (const QString &_cardSetShortName) override
QString getCardCollectorNumber () const override
void setCardCollectorNumber (const QString &_cardSetNumber) override
DecklistCardNodegetDataNode () const
 Returns the underlying data node.
bool isDeckHeader () const override
 Whether this node is the "deck header" (deck metadata).
Public Member Functions inherited from AbstractDecklistCardNode
 AbstractDecklistCardNode (InnerDecklistNode *_parent=nullptr, int position=-1)
 Construct a new AbstractDecklistCardNode.
int height () const override
 Get the height of this node in the tree.
bool compare (AbstractDecklistNode *other) const override
 Compare this card node against another for sorting.
bool compareNumber (AbstractDecklistNode *other) const
 Compare this card node to another by quantity.
bool compareName (AbstractDecklistNode *other) const
 Compare this card node to another by name.
bool readElement (QXmlStreamReader *xml) override
 Deserialize this node’s properties from XML.
void writeElement (QXmlStreamWriter *xml) override
 Serialize this node’s properties to XML.
Public Member Functions inherited from AbstractDecklistNode
 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.
virtual void setSortMethod (DeckSortMethod method)
 Set the sort method for this node’s children.
InnerDecklistNodegetParent () const
int depth () const
 Compute the depth of this node in the tree.

Private Attributes

DecklistCardNodedataNode

Additional Inherited Members

Protected Attributes inherited from AbstractDecklistNode
InnerDecklistNodeparent
 Pointer to the parent node, or nullptr if this is the root.
DeckSortMethod sortMethod
 Current sorting strategy for this node's children.

Detailed Description

Adapter node that wraps a DecklistCardNode for use in the DeckListModel tree.

This class forwards all property accessors (name, number, provider ID, set info, etc.) to the underlying DecklistCardNode. It exists so the model can represent cards in the same hierarchy as InnerDecklistNode containers.

Constructor & Destructor Documentation

◆ DecklistModelCardNode()

DecklistModelCardNode::DecklistModelCardNode ( DecklistCardNode * _dataNode,
InnerDecklistNode * _parent,
int position = -1 )
inline

Constructs a model node wrapping a DecklistCardNode.

Parameters
_dataNodeThe underlying DecklistCardNode to wrap.
_parentThe parent InnerDecklistNode in the model tree.
positionOptional position to insert in parent (-1 appends at end).
Here is the call graph for this function:

Member Function Documentation

◆ getCardCollectorNumber()

QString DecklistModelCardNode::getCardCollectorNumber ( ) const
inlinenodiscardoverridevirtual
Returns
The collector number of the card within its set.

Implements AbstractDecklistCardNode.

◆ getCardProviderId()

QString DecklistModelCardNode::getCardProviderId ( ) const
inlinenodiscardoverridevirtual
Returns
The provider identifier for this card (e.g., UUID).

Implements AbstractDecklistCardNode.

◆ getCardSetShortName()

QString DecklistModelCardNode::getCardSetShortName ( ) const
inlinenodiscardoverridevirtual
Returns
The abbreviated set code (e.g., "NEO").

Implements AbstractDecklistCardNode.

◆ getDataNode()

DecklistCardNode * DecklistModelCardNode::getDataNode ( ) const
inlinenodiscard

Returns the underlying data node.

Returns
Pointer to the DecklistCardNode wrapped by this node.

◆ getName()

QString DecklistModelCardNode::getName ( ) const
inlinenodiscardoverridevirtual
Returns
The display name of this card.

Implements AbstractDecklistCardNode.

◆ getNumber()

int DecklistModelCardNode::getNumber ( ) const
inlinenodiscardoverridevirtual
Returns
The number of copies of this card in the deck.

Implements AbstractDecklistCardNode.

◆ isDeckHeader()

bool DecklistModelCardNode::isDeckHeader ( ) const
inlinenodiscardoverridevirtual

Whether this node is the "deck header" (deck metadata).

This distinguishes special nodes that represent deck-level information rather than cards or groupings.

Implements AbstractDecklistNode.

◆ setCardCollectorNumber()

void DecklistModelCardNode::setCardCollectorNumber ( const QString & _cardSetNumber)
inlineoverridevirtual
Parameters
_cardSetNumberSet the collector number.

Implements AbstractDecklistCardNode.

◆ setCardProviderId()

void DecklistModelCardNode::setCardProviderId ( const QString & _cardProviderId)
inlineoverridevirtual
Parameters
_cardProviderIdSet the provider identifier for this card.

Implements AbstractDecklistCardNode.

◆ setCardSetShortName()

void DecklistModelCardNode::setCardSetShortName ( const QString & _cardSetShortName)
inlineoverridevirtual
Parameters
_cardSetShortNameSet the abbreviated set code.

Implements AbstractDecklistCardNode.

◆ setName()

void DecklistModelCardNode::setName ( const QString & _name)
inlineoverridevirtual
Parameters
_nameSet the display name of this card.

Implements AbstractDecklistCardNode.

◆ setNumber()

void DecklistModelCardNode::setNumber ( int _number)
inlineoverridevirtual
Parameters
_numberSet the number of copies of this card.

Implements AbstractDecklistCardNode.

Member Data Documentation

◆ dataNode

DecklistCardNode* DecklistModelCardNode::dataNode
private

Pointer to the underlying data node.


The documentation for this class was generated from the following file: