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

2048: Let user decide if he wants to continue the game

Before game finish when a player has reached target tile,
Now player will be able to decide if he wants to continue or not
This commit is contained in:
Mohsan Ali 2021-10-04 22:57:13 +05:00 committed by Ali Mohammad Pur
parent accf4b338d
commit d609dde7b0
3 changed files with 18 additions and 8 deletions

View file

@ -34,7 +34,7 @@ public:
size_t turns() const { return m_turns; }
u32 target_tile() const { return m_target_tile; }
u32 largest_tile() const;
void set_want_to_continue() { m_want_to_continue = true; }
class Board {
public:
using Row = Vector<u32>;
@ -119,6 +119,7 @@ private:
u32 m_target_tile { 0 };
bool m_evil_ai { false };
bool m_want_to_continue { false };
Board m_board;
size_t m_score { 0 };