From bb8c37b6150ba326fd07236ccede54d1234d620a Mon Sep 17 00:00:00 2001 From: RickyRister Date: Mon, 25 Nov 2024 20:02:44 -0800 Subject: [PATCH] remove unused parameters from CardList::findCard --- cockatrice/src/game/cards/card_list.cpp | 10 +--------- cockatrice/src/game/cards/card_list.h | 2 +- cockatrice/src/game/zones/card_zone.cpp | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/cockatrice/src/game/cards/card_list.cpp b/cockatrice/src/game/cards/card_list.cpp index e2866e5d8..09eb77e6a 100644 --- a/cockatrice/src/game/cards/card_list.cpp +++ b/cockatrice/src/game/cards/card_list.cpp @@ -9,25 +9,17 @@ CardList::CardList(bool _contentsKnown) : QList(), contentsKnown(_co { } -CardItem *CardList::findCard(const int id, const bool remove, int *position) +CardItem *CardList::findCard(const int id) const { if (!contentsKnown) { if (empty()) return 0; CardItem *temp = at(0); - if (remove) - removeAt(0); - if (position) - *position = id; return temp; } else for (int i = 0; i < size(); i++) { CardItem *temp = at(i); if (temp->getId() == id) { - if (remove) - removeAt(i); - if (position) - *position = i; return temp; } } diff --git a/cockatrice/src/game/cards/card_list.h b/cockatrice/src/game/cards/card_list.h index 1835ca96e..be9b266c8 100644 --- a/cockatrice/src/game/cards/card_list.h +++ b/cockatrice/src/game/cards/card_list.h @@ -20,7 +20,7 @@ public: SortByType = 2 }; CardList(bool _contentsKnown); - CardItem *findCard(const int id, const bool remove, int *position = NULL); + CardItem *findCard(const int id) const; bool getContentsKnown() const { return contentsKnown; diff --git a/cockatrice/src/game/zones/card_zone.cpp b/cockatrice/src/game/zones/card_zone.cpp index 13732f960..7e860d6de 100644 --- a/cockatrice/src/game/zones/card_zone.cpp +++ b/cockatrice/src/game/zones/card_zone.cpp @@ -142,7 +142,7 @@ void CardZone::addCard(CardItem *card, bool reorganize, int x, int y) CardItem *CardZone::getCard(int cardId, const QString &cardName) { - CardItem *c = cards.findCard(cardId, false); + CardItem *c = cards.findCard(cardId); if (!c) { qDebug() << "CardZone::getCard: card id=" << cardId << "not found"; return 0;