[Refactor] Move table row mapping from TableZone into TableZoneLogic

This commit is contained in:
Lukas Brübach 2026-10-06 12:39:15 +02:00 • committed by GitHub
parent c02576b827
commit c7605a51e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 43 additions and 38 deletions

View file

@ -29,6 +29,21 @@ public:
bool _contentsKnown,
QObject *parent = nullptr);
/** @brief Number of rows in the table zone grid (0=creatures, 1=noncreatures, 2=lands). */
static const int ROW_COUNT = 3;
/**
* Clamps a grid row index into [0, ROW_COUNT - 1].
*/
static int clampValidTableRow(const int row);
/**
* Converts a card's logical table row (0=creatures, 1=noncreatures, 2=lands)
* to the corresponding grid Y coordinate. Cards with tableRow > 2 (e.g.,
* instants/sorceries) default to the noncreatures row.
*/
static int tableRowToGridY(int tableRow);
protected:
void addCardImpl(CardItem *card, int x, int y) override;