mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2024-12-25 21:59:30 +01:00
BoardLayout: make a method public, and use it to simplify an assertion
This commit is contained in:
parent
7923ed2c2a
commit
80fa47d71b
2 changed files with 3 additions and 5 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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<int> m_wordMultipliers;
|
||||
Matrix<int> m_tileMultipliers;
|
||||
|
||||
bool isValidCoord(unsigned iRow, unsigned iCol) const;
|
||||
|
||||
void setDefaultLayout();
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue