mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-13 01:24:46 -07:00
[Game] Refactor: add selectedCards method to GameScene (#6859)
This commit is contained in:
parent
7814204fe2
commit
9c53dad4b8
4 changed files with 37 additions and 58 deletions
|
|
@ -309,19 +309,10 @@ void Player::clearCounters()
|
|||
|
||||
void Player::incrementAllCardCounters()
|
||||
{
|
||||
QList<CardItem *> cardsToUpdate;
|
||||
|
||||
auto selectedItems = getGameScene()->selectedItems();
|
||||
if (!selectedItems.isEmpty()) {
|
||||
// If cards are selected, only update those
|
||||
for (const auto &item : selectedItems) {
|
||||
auto *card = static_cast<CardItem *>(item);
|
||||
cardsToUpdate.append(card);
|
||||
}
|
||||
} else {
|
||||
auto cardsToUpdate = getGameScene()->selectedCards();
|
||||
if (cardsToUpdate.isEmpty()) {
|
||||
// If no cards selected, update all cards on table
|
||||
const CardList &tableCards = getTableZone()->getCards();
|
||||
cardsToUpdate = tableCards;
|
||||
cardsToUpdate = static_cast<QList<CardItem *>>(getTableZone()->getCards());
|
||||
}
|
||||
|
||||
QList<const ::google::protobuf::Message *> commandList;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue