mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-20 09:22:15 -07:00
remove unused parameters from CardList::findCard
This commit is contained in:
parent
a8471f62bc
commit
bb8c37b615
3 changed files with 3 additions and 11 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue