Add a method for resetting the game
This commit is contained in:
parent
63bfb5375e
commit
ba28926219
1 changed files with 9 additions and 0 deletions
|
@ -57,6 +57,15 @@ export class Game
|
|||
this.draw();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the game.
|
||||
*/
|
||||
reset()
|
||||
{
|
||||
this.#state = new State();
|
||||
this.draw();
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the content of the board with the current state.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue