remove one last direct iteration of decklist

This commit is contained in:
RickyRister 2025-12-20 20:40:39 -08:00
parent 46c99889d7
commit b0cf289b71
3 changed files with 19 additions and 4 deletions

View file

@ -605,6 +605,17 @@ QList<QString> DeckListModel::getCardNames() const
return names;
}
QList<CardRef> DeckListModel::getCardRefs() const
{
auto nodes = deckList->getCardNodes();
QList<CardRef> cardRefs;
std::transform(nodes.cbegin(), nodes.cend(), std::back_inserter(cardRefs),
[](auto node) { return node->toCardRef(); });
return cardRefs;
}
QList<QString> DeckListModel::getZones() const
{
auto zoneNodes = deckList->getZoneNodes();

View file

@ -330,6 +330,10 @@ public:
* @brief Gets a deduplicated list of all card names that appear in the model
*/
[[nodiscard]] QList<QString> getCardNames() const;
/**
* @brief Gets a deduplicated list of all CardRefs that appear in the model
*/
[[nodiscard]] QList<CardRef> getCardRefs() const;
/**
* @brief Gets a list of all zone names that appear in the model
*/