[Game] Refactor: add selectedCards method to GameScene (#6859)

This commit is contained in:
RickyRister 2026-05-09 17:03:48 -07:00 committed by GitHub
parent 7814204fe2
commit 9c53dad4b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 58 deletions

View file

@ -58,6 +58,18 @@ void GameScene::retranslateUi()
view->retranslateUi();
}
QList<CardItem *> GameScene::selectedCards() const
{
QList<CardItem *> selectedCards;
for (auto item : selectedItems()) {
if (auto card = qgraphicsitem_cast<CardItem *>(item)) {
selectedCards.append(card);
}
}
return selectedCards;
}
/**
* @brief Adds a player to the scene and stores their graphics item.
* @param player Player to add.