mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-24 15:43:54 -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
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue