mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-05 21:13:55 -07:00
Refactor: remove second param from CardZone::getCard (#6041)
This commit is contained in:
parent
a9b3be33e0
commit
95190c321c
4 changed files with 22 additions and 17 deletions
|
|
@ -154,7 +154,7 @@ void CardZone::addCard(CardItem *card, const bool reorganize, const int x, const
|
|||
emit cardCountChanged();
|
||||
}
|
||||
|
||||
CardItem *CardZone::getCard(int cardId, const QString &cardName)
|
||||
CardItem *CardZone::getCard(int cardId)
|
||||
{
|
||||
CardItem *c = cards.findCard(cardId);
|
||||
if (!c) {
|
||||
|
|
@ -162,12 +162,10 @@ CardItem *CardZone::getCard(int cardId, const QString &cardName)
|
|||
return nullptr;
|
||||
}
|
||||
// If the card's id is -1, this zone is invisible,
|
||||
// so we need to give the card an id and a name as it comes out.
|
||||
// so we need to give the card an id as it comes out.
|
||||
// It can be assumed that in an invisible zone, all cards are equal.
|
||||
if ((c->getId() == -1) || (c->getName().isEmpty())) {
|
||||
if (c->getId() == -1) {
|
||||
c->setId(cardId);
|
||||
// TODO: also set providerId
|
||||
c->setCardRef({cardName});
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public:
|
|||
}
|
||||
void addCard(CardItem *card, bool reorganize, int x, int y = -1);
|
||||
// getCard() finds a card by id.
|
||||
CardItem *getCard(int cardId, const QString &cardName);
|
||||
CardItem *getCard(int cardId);
|
||||
// takeCard() finds a card by position and removes it from the zone and from all of its views.
|
||||
virtual CardItem *takeCard(int position, int cardId, bool canResize = true);
|
||||
void removeCard(CardItem *card);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue