Cockatrice 2026-10-19-Development-3.1.2-beta.2
A 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
bool getFormatLegality () const override
void setFormatLegality (const bool _formatLegal) override
DecklistCardNode * getDataNode () 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.
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.
InnerDecklistNode * getParent () const
void setParent (InnerDecklistNode *newParent)
int depth () const
 Compute the depth of this node in the tree.

Private Attributes

DecklistCardNode * dataNode

Additional Inherited Members

Protected Attributes inherited from AbstractDecklistNode
InnerDecklistNode * parent
 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:
Here is the caller 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.

Here is the call graph for this function:

◆ getCardProviderId()

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

Implements AbstractDecklistCardNode.

Here is the call graph for this function:

◆ getCardSetShortName()

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

Implements AbstractDecklistCardNode.

Here is the call graph for this function:

◆ getDataNode()

DecklistCardNode * DecklistModelCardNode::getDataNode ( ) const
inlinenodiscard

Returns the underlying data node.

Returns
Pointer to the DecklistCardNode wrapped by this node.

◆ getFormatLegality()

bool DecklistModelCardNode::getFormatLegality ( ) const
inlineoverridevirtual
Returns
The format legality of the card.

Implements AbstractDecklistCardNode.

Here is the call graph for this function:

◆ getName()

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

Implements AbstractDecklistCardNode.

Here is the call graph for this function:

◆ getNumber()

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

Implements AbstractDecklistCardNode.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ setCardProviderId()

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

Implements AbstractDecklistCardNode.

Here is the call graph for this function:

◆ setCardSetShortName()

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

Implements AbstractDecklistCardNode.

Here is the call graph for this function:

◆ setFormatLegality()

void DecklistModelCardNode::setFormatLegality ( const bool _formatLegal)
inlineoverridevirtual
Parameters
_formatLegalIf the card is considered legal.

Implements AbstractDecklistCardNode.

Here is the call graph for this function:

◆ setName()

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

Implements AbstractDecklistCardNode.

Here is the call graph for this function:

◆ setNumber()

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

Implements AbstractDecklistCardNode.

Here is the call graph for this function:

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: