diff --git a/game/board.cpp b/game/board.cpp index 5bde1ad..cd7286e 100644 --- a/game/board.cpp +++ b/game/board.cpp @@ -94,9 +94,7 @@ bool Board::isJoker(int iRow, int iCol) const bool Board::isVacant(int iRow, int iCol) const { - ASSERT(iRow >= 1 && (unsigned)iRow <= m_layout.getRowCount() && - iCol >= 1 && (unsigned)iCol <= m_layout.getColCount(), - "Invalid coordinates"); + ASSERT(m_layout.isValidCoord(iRow, iCol), "Invalid coordinates"); return m_tilesRow[iRow][iCol].isEmpty(); } diff --git a/game/board_layout.h b/game/board_layout.h index 7632e4f..fa52cc3 100644 --- a/game/board_layout.h +++ b/game/board_layout.h @@ -34,6 +34,8 @@ class BoardLayout public: BoardLayout(); + bool isValidCoord(unsigned iRow, unsigned iCol) const; + unsigned getRowCount() const; unsigned getColCount() const; int getWordMultiplier(unsigned iRow, unsigned iCol) const; @@ -48,8 +50,6 @@ private: Matrix m_wordMultipliers; Matrix m_tileMultipliers; - bool isValidCoord(unsigned iRow, unsigned iCol) const; - void setDefaultLayout(); };