mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-12 05:14:16 -07:00
[DeckListModel] remove more access to underlying decklist for iteration
This commit is contained in:
parent
73a90bdf38
commit
46c99889d7
4 changed files with 16 additions and 6 deletions
|
|
@ -561,6 +561,11 @@ void DeckListModel::setDeckList(DeckList *_deck)
|
|||
rebuildTree();
|
||||
}
|
||||
|
||||
void DeckListModel::forEachCard(const std::function<void(InnerDecklistNode *, DecklistCardNode *)> &func)
|
||||
{
|
||||
deckList->forEachCard(func);
|
||||
}
|
||||
|
||||
static QList<ExactCard> cardNodesToExactCards(QList<const DecklistCardNode *> nodes)
|
||||
{
|
||||
QList<ExactCard> cards;
|
||||
|
|
|
|||
|
|
@ -309,6 +309,13 @@ public:
|
|||
}
|
||||
void setDeckList(DeckList *_deck);
|
||||
|
||||
/**
|
||||
* @brief Apply a function to every card in the deck tree.
|
||||
*
|
||||
* @param func Function taking (zone node, card node).
|
||||
*/
|
||||
void forEachCard(const std::function<void(InnerDecklistNode *, DecklistCardNode *)> &func);
|
||||
|
||||
/**
|
||||
* @brief Creates a list consisting of the entries of the model mapped into ExactCards (with each entry looked up
|
||||
* in the card database).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue