mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-13 22:12:15 -07:00
remove one last direct iteration of decklist
This commit is contained in:
parent
46c99889d7
commit
b0cf289b71
3 changed files with 19 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue