[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:
BruebachL 2026-10-31 18:44:14 +01:00 • committed by GitHub
parent 65e9f1b370
commit 7ca23430cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 138 additions and 136 deletions

View file

@ -86,7 +86,7 @@ CardMenu::CardMenu(PlayerGraphicsItem *_player, CardItem *_card, bool _shortcuts
auto *gameScene = player->getGameScene();
// Single selection resolver used by all lambdas — called at trigger time
auto sel = [gameScene]() { return gameScene->selectedCards(); };
auto sel = [gameScene]() { return gameScene->selectedCardStates(); };
// Unified dispatcher for card menu actions
auto invoke = [actions, sel](CardMenuActionType type) {
@ -337,7 +337,7 @@ void CardMenu::createHandOrCustomZoneMenu(bool canModifyCard)
initContextualPlayersMenu(revealMenu, aRevealToAll);
connect(revealMenu, &QMenu::triggered, this, [this](QAction *action) {
player->getLogic()->getPlayerActions()->actReveal(player->getGameScene()->selectedCards(), action);
player->getLogic()->getPlayerActions()->actReveal(player->getGameScene()->selectedCardStates(), action);
});
addSeparator();
@ -486,8 +486,9 @@ void CardMenu::addRelatedCardActions()
auto *createRelated = new QAction(text, this);
const int relatedIndex = index++;
connect(createRelated, &QAction::triggered, this,
[this, playerActions, relatedIndex] { playerActions->actCreateRelatedCard(card, relatedIndex); });
connect(createRelated, &QAction::triggered, this, [this, playerActions, relatedIndex] {
playerActions->actCreateRelatedCard(card->getState(), relatedIndex);
});
addAction(createRelated);
}
@ -497,7 +498,7 @@ void CardMenu::addRelatedCardActions()
SettingsCache::instance().shortcuts().getShortcut("Player/aCreateRelatedTokens"));
}
connect(createRelatedCards, &QAction::triggered, this,
[this, playerActions] { playerActions->actCreateAllRelatedCards(card); });
[this, playerActions] { playerActions->actCreateAllRelatedCards(card->getState()); });
addAction(createRelatedCards);
}
}