1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:27:35 +00:00

2048: Do not allow the creation of games with invalid board sizes

The logic only works with nxn grids, so no need to take separate
row_size/column_size arguments.
This commit is contained in:
AnotherTest 2020-08-19 18:24:03 +04:30 committed by Andreas Kling
parent 16e86a3dda
commit 40c16b3ce5
3 changed files with 11 additions and 13 deletions

View file

@ -30,7 +30,7 @@
class Game final {
public:
Game(size_t rows, size_t columns);
Game(size_t);
Game(const Game&) = default;
enum class MoveOutcome {
@ -59,8 +59,7 @@ public:
private:
void add_random_tile();
size_t m_rows { 0 };
size_t m_columns { 0 };
size_t m_grid_size { 0 };
Board m_board;
size_t m_score { 0 };