[Game] Use TableZoneLogic::ROW_COUNT directly per review

This commit is contained in:
BruebachL 2026-10-13 11:48:13 +02:00 • committed by GitHub
parent c7605a51e2
commit 276cdebed4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 7 deletions

View file

@ -62,7 +62,7 @@ TableZone::TableZone(TableZoneLogic *_logic, bool _mirrored, QGraphicsItem *pare
updateBg(); updateBg();
height = MARGIN_TOP + MARGIN_BOTTOM + TABLEROWS * CardDimensions::HEIGHT + (TABLEROWS - 1) * PADDING_Y; height = MARGIN_TOP + MARGIN_BOTTOM + TableZoneLogic::ROW_COUNT * CardDimensions::HEIGHT + (TableZoneLogic::ROW_COUNT - 1) * PADDING_Y;
width = MIN_WIDTH; width = MIN_WIDTH;
currentMinimumWidth = width; currentMinimumWidth = width;
@ -397,7 +397,7 @@ QPointF TableZone::mapFromGrid(QPoint gridPoint) const
} }
if (isInverted()) { if (isInverted()) {
gridPoint.setY(TABLEROWS - 1 - gridPoint.y()); gridPoint.setY(TableZoneLogic::ROW_COUNT - 1 - gridPoint.y());
} }
// Start with margin plus stacked card offset // Start with margin plus stacked card offset
@ -426,7 +426,7 @@ QPoint TableZone::mapToGrid(const QPointF &mapPoint) const
gridPointY = TableZoneLogic::clampValidTableRow(gridPointY); gridPointY = TableZoneLogic::clampValidTableRow(gridPointY);
if (isInverted()) { if (isInverted()) {
gridPointY = TABLEROWS - 1 - gridPointY; gridPointY = TableZoneLogic::ROW_COUNT - 1 - gridPointY;
} }
// Calculating the x-coordinate of the grid space requires adding up the // Calculating the x-coordinate of the grid space requires adding up the

View file

@ -7,10 +7,10 @@
#ifndef TABLEZONE_H #ifndef TABLEZONE_H
#define TABLEZONE_H #define TABLEZONE_H
#include "../../game/zones/table_zone_logic.h"
#include "../animated_item.h" #include "../animated_item.h"
#include "../card_dimensions.h" #include "../card_dimensions.h"
#include "select_zone.h" #include "select_zone.h"
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QMap> #include <QMap>
#include <QPixmap> #include <QPixmap>
@ -25,7 +25,6 @@ class CardZoneLogic;
class QColor; class QColor;
class QGraphicsItem; class QGraphicsItem;
class QPainter; class QPainter;
class TableZoneLogic;
template <typename T> class QList; template <typename T> class QList;
/** /**
@ -42,8 +41,6 @@ signals:
void sizeChanged(); void sizeChanged();
private: private:
static const int TABLEROWS = TableZoneLogic::ROW_COUNT;
/* /*
Margins between table edges and cards, paddings between cards Margins between table edges and cards, paddings between cards
*/ */