mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 18:43:55 -07:00
Standardize Doxygen documentation (#6885)
This commit is contained in:
parent
03d54265fe
commit
33e0f8699b
306 changed files with 539 additions and 487 deletions
|
|
@ -89,7 +89,7 @@ private:
|
|||
mutable QString cachedDeckHash;
|
||||
|
||||
public:
|
||||
/// @name Metadata setters
|
||||
/** @name Metadata setters */
|
||||
///@{
|
||||
void setName(const QString &_name = QString())
|
||||
{
|
||||
|
|
@ -125,11 +125,11 @@ public:
|
|||
}
|
||||
///@}
|
||||
|
||||
/// @brief Construct an empty deck.
|
||||
/** @brief Construct an empty deck. */
|
||||
explicit DeckList();
|
||||
/// @brief Construct from a serialized native-format string.
|
||||
/** @brief Construct from a serialized native-format string. */
|
||||
explicit DeckList(const QString &nativeString);
|
||||
/// @brief Construct from components
|
||||
/** @brief Construct from components. */
|
||||
DeckList(const Metadata &metadata,
|
||||
const DecklistNodeTree &tree,
|
||||
const QMap<QString, SideboardPlan> &sideboardPlans = {});
|
||||
|
|
@ -144,8 +144,10 @@ public:
|
|||
return &tree;
|
||||
}
|
||||
|
||||
/// @name Metadata getters
|
||||
/// The individual metadata getters still exist for backwards compatibility.
|
||||
/**
|
||||
* @name Metadata getters
|
||||
* The individual metadata getters still exist for backwards compatibility.
|
||||
*/
|
||||
///@{
|
||||
//! \todo Figure out when we can remove them.
|
||||
const Metadata &getMetadata() const
|
||||
|
|
@ -183,7 +185,7 @@ public:
|
|||
return metadata.isEmpty() && getCardList().isEmpty();
|
||||
}
|
||||
|
||||
/// @name Sideboard plans
|
||||
/** @name Sideboard plans */
|
||||
///@{
|
||||
QList<MoveCard_ToZone> getCurrentSideboardPlan() const;
|
||||
void setCurrentSideboardPlan(const QList<MoveCard_ToZone> &plan);
|
||||
|
|
@ -193,7 +195,7 @@ public:
|
|||
}
|
||||
///@}
|
||||
|
||||
/// @name Serialization (XML)
|
||||
/** @name Serialization (XML) */
|
||||
///@{
|
||||
bool readElement(QXmlStreamReader *xml);
|
||||
void write(QXmlStreamWriter *xml) const;
|
||||
|
|
@ -204,7 +206,7 @@ public:
|
|||
bool saveToFile_Native(QIODevice *device) const;
|
||||
///@}
|
||||
|
||||
/// @name Serialization (Plain text)
|
||||
/** @name Serialization (Plain text) */
|
||||
///@{
|
||||
bool loadFromStream_Plain(QTextStream &stream,
|
||||
bool preserveMetadata,
|
||||
|
|
@ -216,7 +218,7 @@ public:
|
|||
QString writeToString_Plain(bool prefixSideboardCards = true, bool slashTappedOutSplitCards = false) const;
|
||||
///@}
|
||||
|
||||
/// @name Deck manipulation
|
||||
/** @name Deck manipulation */
|
||||
///@{
|
||||
void cleanList(bool preserveMetadata = false);
|
||||
bool isEmpty() const
|
||||
|
|
@ -238,7 +240,7 @@ public:
|
|||
const bool formatLegal = true);
|
||||
///@}
|
||||
|
||||
/// @name Deck identity
|
||||
/** @name Deck identity */
|
||||
///@{
|
||||
QString getDeckHash() const;
|
||||
void refreshDeckHash();
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ class DecklistNodeTree
|
|||
InnerDecklistNode *root; ///< Root of the deck tree (zones + cards).
|
||||
|
||||
public:
|
||||
/// @brief Constructs an empty DecklistNodeTree
|
||||
/** @brief Constructs an empty DecklistNodeTree. */
|
||||
explicit DecklistNodeTree();
|
||||
/// @brief Copy constructor. Deep copies the tree
|
||||
/** @brief Copy constructor. Deep copies the tree. */
|
||||
explicit DecklistNodeTree(const DecklistNodeTree &other);
|
||||
/// @brief Copy-assignment operator. Deep copies the tree
|
||||
/** @brief Copy-assignment operator. Deep copies the tree. */
|
||||
DecklistNodeTree &operator=(const DecklistNodeTree &other);
|
||||
|
||||
virtual ~DecklistNodeTree();
|
||||
|
|
|
|||
|
|
@ -51,19 +51,19 @@ public:
|
|||
*/
|
||||
void write(QXmlStreamWriter *xml) const;
|
||||
|
||||
/// @return The plan name.
|
||||
/** @return The plan name. */
|
||||
[[nodiscard]] QString getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/// @return Const reference to the move list.
|
||||
/** @return Const reference to the move list. */
|
||||
[[nodiscard]] const QList<MoveCard_ToZone> &getMoveList() const
|
||||
{
|
||||
return moveList;
|
||||
}
|
||||
|
||||
/// @brief Replace the move list with a new one.
|
||||
/** @brief Replace the move list with a new one. */
|
||||
void setMoveList(const QList<MoveCard_ToZone> &_moveList);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -58,40 +58,40 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
/// @return The number of copies of this card in the deck.
|
||||
/** @return The number of copies of this card in the deck. */
|
||||
[[nodiscard]] virtual int getNumber() const = 0;
|
||||
|
||||
/// @param _number Set the number of copies of this card.
|
||||
/** @param _number Set the number of copies of this card. */
|
||||
virtual void setNumber(int _number) = 0;
|
||||
|
||||
/// @return The display name of this card.
|
||||
/** @return The display name of this card. */
|
||||
[[nodiscard]] QString getName() const override = 0;
|
||||
|
||||
/// @param _name Set the display name of this card.
|
||||
/** @param _name Set the display name of this card. */
|
||||
virtual void setName(const QString &_name) = 0;
|
||||
|
||||
/// @return The provider identifier for this card (e.g., UUID).
|
||||
/** @return The provider identifier for this card (e.g., UUID). */
|
||||
[[nodiscard]] virtual QString getCardProviderId() const override = 0;
|
||||
|
||||
/// @param _cardProviderId Set the provider identifier for this card.
|
||||
/** @param _cardProviderId Set the provider identifier for this card. */
|
||||
virtual void setCardProviderId(const QString &_cardProviderId) = 0;
|
||||
|
||||
/// @return The abbreviated set code (e.g., "NEO").
|
||||
/** @return The abbreviated set code (e.g., "NEO"). */
|
||||
[[nodiscard]] virtual QString getCardSetShortName() const override = 0;
|
||||
|
||||
/// @param _cardSetShortName Set the abbreviated set code.
|
||||
/** @param _cardSetShortName Set the abbreviated set code. */
|
||||
virtual void setCardSetShortName(const QString &_cardSetShortName) = 0;
|
||||
|
||||
/// @return The collector number of the card within its set.
|
||||
/** @return The collector number of the card within its set. */
|
||||
[[nodiscard]] virtual QString getCardCollectorNumber() const override = 0;
|
||||
|
||||
/// @param _cardSetNumber Set the collector number.
|
||||
/** @param _cardSetNumber Set the collector number. */
|
||||
virtual void setCardCollectorNumber(const QString &_cardSetNumber) = 0;
|
||||
|
||||
/// @return The format legality of the card
|
||||
/** @return The format legality of the card. */
|
||||
virtual bool getFormatLegality() const = 0;
|
||||
|
||||
/// @param _formatLegal If the card is considered legal
|
||||
/** @param _formatLegal If the card is considered legal. */
|
||||
virtual void setFormatLegality(const bool _formatLegal) = 0;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ public:
|
|||
*/
|
||||
explicit AbstractDecklistNode(InnerDecklistNode *_parent = nullptr, int position = -1);
|
||||
|
||||
/// Virtual destructor. Child classes must clean up their resources.
|
||||
/** @brief Virtual destructor. Child classes must clean up their resources. */
|
||||
virtual ~AbstractDecklistNode() = default;
|
||||
|
||||
/**
|
||||
|
|
@ -136,7 +136,7 @@ public:
|
|||
*/
|
||||
[[nodiscard]] virtual bool isDeckHeader() const = 0;
|
||||
|
||||
/// @return The parent node, or nullptr if this is the root.
|
||||
/** @return The parent node, or nullptr if this is the root. */
|
||||
[[nodiscard]] InnerDecklistNode *getParent() const
|
||||
{
|
||||
return parent;
|
||||
|
|
|
|||
|
|
@ -93,79 +93,79 @@ public:
|
|||
*/
|
||||
explicit DecklistCardNode(DecklistCardNode *other, InnerDecklistNode *_parent);
|
||||
|
||||
/// @return The quantity of this card.
|
||||
/** @return The quantity of this card. */
|
||||
[[nodiscard]] int getNumber() const override
|
||||
{
|
||||
return number;
|
||||
}
|
||||
|
||||
/// @param _number Set the quantity of this card.
|
||||
/** @param _number Set the quantity of this card. */
|
||||
void setNumber(int _number) override
|
||||
{
|
||||
number = _number;
|
||||
}
|
||||
|
||||
/// @return The display name of this card.
|
||||
/** @return The display name of this card. */
|
||||
[[nodiscard]] QString getName() const override
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/// @param _name Set the display name of this card.
|
||||
/** @param _name Set the display name of this card. */
|
||||
void setName(const QString &_name) override
|
||||
{
|
||||
name = _name;
|
||||
}
|
||||
|
||||
/// @return The provider identifier for this card.
|
||||
/** @return The provider identifier for this card. */
|
||||
[[nodiscard]] QString getCardProviderId() const override
|
||||
{
|
||||
return cardProviderId;
|
||||
}
|
||||
|
||||
/// @param _providerId Set the provider identifier for this card.
|
||||
/** @param _providerId Set the provider identifier for this card. */
|
||||
void setCardProviderId(const QString &_providerId) override
|
||||
{
|
||||
cardProviderId = _providerId;
|
||||
}
|
||||
|
||||
/// @return The short set code (e.g., "NEO").
|
||||
/** @return The short set code (e.g., "NEO"). */
|
||||
[[nodiscard]] QString getCardSetShortName() const override
|
||||
{
|
||||
return cardSetShortName;
|
||||
}
|
||||
|
||||
/// @param _cardSetShortName Set the short set code.
|
||||
/** @param _cardSetShortName Set the short set code. */
|
||||
void setCardSetShortName(const QString &_cardSetShortName) override
|
||||
{
|
||||
cardSetShortName = _cardSetShortName;
|
||||
}
|
||||
|
||||
/// @return The collector number of this card within its set.
|
||||
/** @return The collector number of this card within its set. */
|
||||
[[nodiscard]] QString getCardCollectorNumber() const override
|
||||
{
|
||||
return cardSetNumber;
|
||||
}
|
||||
|
||||
/// @param _cardSetNumber Set the collector number.
|
||||
/** @param _cardSetNumber Set the collector number. */
|
||||
void setCardCollectorNumber(const QString &_cardSetNumber) override
|
||||
{
|
||||
cardSetNumber = _cardSetNumber;
|
||||
}
|
||||
|
||||
/// @return The format legality of the card
|
||||
/** @return The format legality of the card. */
|
||||
[[nodiscard]] bool getFormatLegality() const override
|
||||
{
|
||||
return formatLegal;
|
||||
}
|
||||
|
||||
/// @param _formatLegal If the card is considered legal
|
||||
/** @param _formatLegal If the card is considered legal. */
|
||||
void setFormatLegality(const bool _formatLegal) override
|
||||
{
|
||||
formatLegal = _formatLegal;
|
||||
}
|
||||
|
||||
/// @return Always false; card nodes are not deck headers.
|
||||
/** @return Always false; card nodes are not deck headers. */
|
||||
[[nodiscard]] bool isDeckHeader() const override
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@
|
|||
|
||||
#include "abstract_deck_list_node.h"
|
||||
|
||||
/// Constant for the "main" deck zone name.
|
||||
/** @brief Constant for the "main" deck zone name. */
|
||||
#define DECK_ZONE_MAIN "main"
|
||||
/// Constant for the "sideboard" zone name.
|
||||
/** @brief Constant for the "sideboard" zone name. */
|
||||
#define DECK_ZONE_SIDE "side"
|
||||
/// Constant for the "tokens" zone name.
|
||||
/** @brief Constant for the "tokens" zone name. */
|
||||
#define DECK_ZONE_TOKENS "tokens"
|
||||
|
||||
/**
|
||||
|
|
@ -93,13 +93,13 @@ public:
|
|||
*/
|
||||
void setSortMethod(DeckSortMethod method) override;
|
||||
|
||||
/// @return The internal name of this node.
|
||||
/** @return The internal name of this node. */
|
||||
[[nodiscard]] QString getName() const override
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/// @param _name Set the internal name of this node.
|
||||
/** @param _name Set the internal name of this node. */
|
||||
void setName(const QString &_name)
|
||||
{
|
||||
name = _name;
|
||||
|
|
@ -122,25 +122,25 @@ public:
|
|||
*/
|
||||
[[nodiscard]] virtual QString getVisibleName() const;
|
||||
|
||||
/// @return Always empty for container nodes.
|
||||
/** @return Always empty for container nodes. */
|
||||
[[nodiscard]] QString getCardProviderId() const override
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
/// @return Always empty for container nodes.
|
||||
/** @return Always empty for container nodes. */
|
||||
[[nodiscard]] QString getCardSetShortName() const override
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
/// @return Always empty for container nodes.
|
||||
/** @return Always empty for container nodes. */
|
||||
[[nodiscard]] QString getCardCollectorNumber() const override
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
/// @return Always true; InnerDecklistNode represents deck structure.
|
||||
/** @return Always true; InnerDecklistNode represents deck structure. */
|
||||
[[nodiscard]] bool isDeckHeader() const override
|
||||
{
|
||||
return true;
|
||||
|
|
@ -196,10 +196,10 @@ public:
|
|||
*/
|
||||
bool compare(AbstractDecklistNode *other) const override;
|
||||
|
||||
/// @copydoc compare(AbstractDecklistNode*) const
|
||||
/** @copydoc compare(AbstractDecklistNode*) const */
|
||||
bool compareNumber(AbstractDecklistNode *other) const;
|
||||
|
||||
/// @copydoc compare(AbstractDecklistNode*) const
|
||||
/** @copydoc compare(AbstractDecklistNode*) const */
|
||||
bool compareName(AbstractDecklistNode *other) const;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue