[Refactor] Move card selection actions to GameScene and p/t parsing to CardState (#7426)

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-10-31 18:44:12 +01:00 • committed by GitHub
parent c9853734ad
commit 4879ddbd0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 121 additions and 116 deletions

View file

@ -16,7 +16,7 @@ static int sumPowers(const QList<CardItem *> &cards)
// calculate total power;
int total = 0;
for (auto card : cards) {
QVariantList parsed = CardItem::parsePT(card->getPT());
QVariantList parsed = CardState::parsePT(card->getPT());
if (!parsed.isEmpty()) {
int power = parsed.first().toInt(); // toInt will default to 0 if it's not an int
total += qMax(power, 0);
@ -44,7 +44,7 @@ static int sumToughness(const QList<CardItem *> &cards)
{
int total = 0;
for (auto card : cards) {
QVariantList parsed = CardItem::parsePT(card->getPT());
QVariantList parsed = CardState::parsePT(card->getPT());
if (parsed.size() == 2) {
int toughness = parsed.at(1).toInt(); // toInt will default to 0 if it's not an int
total += qMax(toughness, 0);