mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
[DeckList] Refactor and cleanup methods that iterate over nodes (#6407)
* remove helpers * create getZoneNodes method * replace direct calls to getRoot and forEachCard * remove more non-const uses of forEachCard * make node getter return const lists * one more usage * address comment * address comment again * fix hash * fix hashes (for real this time)
This commit is contained in:
parent
a390c8ada7
commit
2e2682aad4
16 changed files with 125 additions and 202 deletions
|
|
@ -228,7 +228,7 @@ QMap<QString, int> DlgSelectSetForCards::getSetsForCards()
|
|||
if (!decklist)
|
||||
return setCounts;
|
||||
|
||||
QList<DecklistCardNode *> cardsInDeck = decklist->getCardNodes();
|
||||
QList<const DecklistCardNode *> cardsInDeck = decklist->getCardNodes();
|
||||
|
||||
for (auto currentCard : cardsInDeck) {
|
||||
CardInfoPtr infoPtr = CardDatabaseManager::query()->getCardInfo(currentCard->getName());
|
||||
|
|
@ -271,7 +271,7 @@ void DlgSelectSetForCards::updateCardLists()
|
|||
if (!decklist)
|
||||
return;
|
||||
|
||||
QList<DecklistCardNode *> cardsInDeck = decklist->getCardNodes();
|
||||
QList<const DecklistCardNode *> cardsInDeck = decklist->getCardNodes();
|
||||
|
||||
for (auto currentCard : cardsInDeck) {
|
||||
bool found = false;
|
||||
|
|
@ -360,7 +360,7 @@ QMap<QString, QStringList> DlgSelectSetForCards::getCardsForSets()
|
|||
if (!decklist)
|
||||
return setCards;
|
||||
|
||||
QList<DecklistCardNode *> cardsInDeck = decklist->getCardNodes();
|
||||
QList<const DecklistCardNode *> cardsInDeck = decklist->getCardNodes();
|
||||
|
||||
for (auto currentCard : cardsInDeck) {
|
||||
CardInfoPtr infoPtr = CardDatabaseManager::query()->getCardInfo(currentCard->getName());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue