[Refactor] Retype card containers and zone logic onto CardState

This commit is contained in:
Lukas Brübach 2026-10-07 09:27:34 +02:00 • committed by GitHub
parent 893aeb7bae
commit f321132cce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 184 additions and 158 deletions

View file

@ -1614,7 +1614,9 @@ void PlayerActions::actIncrementAllCardCounters(QList<CardItem *> cardsToUpdate)
{
if (cardsToUpdate.isEmpty()) {
// If no cards selected, update all cards on table
cardsToUpdate = static_cast<QList<CardItem *>>(player->getTableZone()->getCards());
for (auto *state : player->getTableZone()->getCards()) {
cardsToUpdate.append(qobject_cast<CardItem *>(state->parent()));
}
}
QList<const ::google::protobuf::Message *> commandList;
@ -1687,7 +1689,7 @@ void PlayerActions::actHide(QList<CardItem *> selectedCards)
for (const auto &item : selectedCards) {
auto *card = static_cast<CardItem *>(item);
if (card && isUnwritableRevealZone(card->getZone())) {
card->getZone()->removeCard(card);
card->getZone()->removeCard(card->getState());
}
}
}