mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-13 17:44:48 -07:00
[DeckListModel] add getCardNodes method (#6484)
* [DeckListModel] add getCardNodes method * Update one usage
This commit is contained in:
parent
73cc0541f5
commit
84aefda486
3 changed files with 17 additions and 1 deletions
|
|
@ -168,7 +168,7 @@ void DrawProbabilityWidget::updateFilterOptions()
|
||||||
QMap<QString, int> categoryCounts;
|
QMap<QString, int> categoryCounts;
|
||||||
int totalDeckCards = 0;
|
int totalDeckCards = 0;
|
||||||
|
|
||||||
const auto nodes = analyzer->getModel()->getDeckList()->getCardNodes();
|
const auto nodes = analyzer->getModel()->getCardNodes();
|
||||||
for (auto *node : nodes) {
|
for (auto *node : nodes) {
|
||||||
CardInfoPtr info = CardDatabaseManager::query()->getCard({node->getName()}).getCardPtr();
|
CardInfoPtr info = CardDatabaseManager::query()->getCard({node->getName()}).getCardPtr();
|
||||||
if (!info) {
|
if (!info) {
|
||||||
|
|
|
||||||
|
|
@ -637,6 +637,16 @@ QList<ExactCard> DeckListModel::getCardsForZone(const QString &zoneName) const
|
||||||
return cardNodesToExactCards(nodes);
|
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
|
QList<QString> DeckListModel::getCardNames() const
|
||||||
{
|
{
|
||||||
auto nodes = deckList->getCardNodes();
|
auto nodes = deckList->getCardNodes();
|
||||||
|
|
|
||||||
|
|
@ -339,6 +339,12 @@ public:
|
||||||
[[nodiscard]] QList<ExactCard> getCards() const;
|
[[nodiscard]] QList<ExactCard> getCards() const;
|
||||||
[[nodiscard]] QList<ExactCard> getCardsForZone(const QString &zoneName) 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
|
* @brief Gets a deduplicated list of all card names that appear in the model
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue