mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[Refactor] Retype PlayerActions onto CardState (#7435)
* [Refactor] Retype card containers and zone logic onto CardState * [Refactor] Retype PlayerActions onto CardState --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
65e9f1b370
commit
7ca23430cd
18 changed files with 138 additions and 136 deletions
|
|
@ -266,16 +266,16 @@ void TableZone::reorganizeCards()
|
|||
|
||||
void TableZone::toggleTapped()
|
||||
{
|
||||
QList<CardItem *> selectedCards;
|
||||
QList<CardState *> selectedCards;
|
||||
for (auto *item : scene()->selectedItems()) {
|
||||
auto *card = qgraphicsitem_cast<CardItem *>(item);
|
||||
if (card && card->getZone()->getName() == ZoneNames::TABLE) {
|
||||
selectedCards.append(card);
|
||||
selectedCards.append(card->getState());
|
||||
}
|
||||
}
|
||||
|
||||
const bool tapAll = std::any_of(selectedCards.begin(), selectedCards.end(),
|
||||
[](const CardItem *card) { return !card->getTapped(); });
|
||||
[](const CardState *card) { return !card->getTapped(); });
|
||||
|
||||
getLogic()->getPlayer()->getPlayerActions()->actToggleTapped(getLogic()->getName(), selectedCards, tapAll);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue