[Refactor] Move table row mapping from TableZone into TableZoneLogic (#7413)

* [Refactor] Move table row mapping from TableZone into TableZoneLogic

* [Game] Use TableZoneLogic::ROW_COUNT directly per review

* [Format] Match clang-format line breaking in table_zone

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-10-31 18:44:07 +01:00 • committed by GitHub
parent d30d275296
commit 52c5bd2ea3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 47 additions and 43 deletions

View file

@ -40,4 +40,23 @@ CardItem *TableZoneLogic::takeCard(int position, int cardId, bool toNewZone)
emit contentSizeChanged();
}
return result;
}
}
int TableZoneLogic::clampValidTableRow(const int row)
{
if (row < 0) {
return 0;
}
if (row >= ROW_COUNT) {
return ROW_COUNT - 1;
}
return row;
}
int TableZoneLogic::tableRowToGridY(int tableRow)
{
if (tableRow > 2) {
tableRow = 1;
}
return clampValidTableRow(2 - tableRow);
}