remove unused parameters from CardList::findCard

This commit is contained in:
RickyRister 2024-11-25 20:02:44 -08:00
parent a8471f62bc
commit bb8c37b615
3 changed files with 3 additions and 11 deletions

View file

@ -9,25 +9,17 @@ CardList::CardList(bool _contentsKnown) : QList<CardItem *>(), 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;
}
}

View file

@ -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;

View file

@ -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;