Commit 918a00f2 authored by Yanjie He's avatar Yanjie He Committed by Albert Astals Cid

Add const values 'nRows' and 'nCols'

Summary: Replace the previous usages of integer 8 with 'nRows' and 'nCols'.

Reviewers: #kde_games, aacid

Reviewed By: aacid

Subscribers: aacid, chehrlic, kde-games-devel

Differential Revision: https://phabricator.kde.org/D27105
parent 5a1c9286
......@@ -41,6 +41,9 @@ enum ChipColor {
NoColor = 2
};
static const int nRows = 8;
static const int nCols = 8;
/**
* Represents position on board.
*/
......@@ -52,7 +55,7 @@ struct KReversiPos {
int col;
bool isValid() const {
return (row >= 0 && col >= 0 && row < 8 && col < 8);
return (row >= 0 && col >= 0 && row < nRows && col < nCols);
}
};
......@@ -72,7 +75,7 @@ struct KReversiMove: public KReversiPos {
bool isValid() const {
return (color != NoColor
&& row >= 0 && col >= 0
&& row < 8 && col < 8);
&& row < nRows && col < nCols);
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment