mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-14 22:13:48 -08:00
[DeckListModel] add getCardNodes method (#6484)
* [DeckListModel] add getCardNodes method * Update one usage
This commit is contained in:
@@ -168,7 +168,7 @@ void DrawProbabilityWidget::updateFilterOptions()
|
||||
QMap<QString, int> categoryCounts;
|
||||
int totalDeckCards = 0;
|
||||
|
||||
const auto nodes = analyzer->getModel()->getDeckList()->getCardNodes();
|
||||
const auto nodes = analyzer->getModel()->getCardNodes();
|
||||
for (auto *node : nodes) {
|
||||
CardInfoPtr info = CardDatabaseManager::query()->getCard({node->getName()}).getCardPtr();
|
||||
if (!info) {
|
||||
|
||||
@@ -637,6 +637,16 @@ QList<ExactCard> DeckListModel::getCardsForZone(const QString &zoneName) const
|
||||
return cardNodesToExactCards(nodes);
|
||||
}
|
||||
|
||||
QList<const DecklistCardNode *> DeckListModel::getCardNodes() const
|
||||
{
|
||||
return deckList->getCardNodes();
|
||||
}
|
||||
|
||||
QList<const DecklistCardNode *> DeckListModel::getCardNodesForZone(const QString &zoneName) const
|
||||
{
|
||||
return deckList->getCardNodes({zoneName});
|
||||
}
|
||||
|
||||
QList<QString> DeckListModel::getCardNames() const
|
||||
{
|
||||
auto nodes = deckList->getCardNodes();
|
||||
|
||||
@@ -339,6 +339,12 @@ public:
|
||||
[[nodiscard]] QList<ExactCard> getCards() const;
|
||||
[[nodiscard]] QList<ExactCard> getCardsForZone(const QString &zoneName) const;
|
||||
|
||||
/**
|
||||
* @brief Gets a list of all card nodes in the deck.
|
||||
*/
|
||||
[[nodiscard]] QList<const DecklistCardNode *> getCardNodes() const;
|
||||
[[nodiscard]] QList<const DecklistCardNode *> getCardNodesForZone(const QString &zoneName) const;
|
||||
|
||||
/**
|
||||
* @brief Gets a deduplicated list of all card names that appear in the model
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user