mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-09 19:43:26 -08:00
[Refactor] Move table row mapping from TableZone into TableZoneLogic
This commit is contained in:
parent
c02576b827
commit
c7605a51e2
5 changed files with 43 additions and 38 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue