Add a method for resetting the game
This commit is contained in:
parent
63bfb5375e
commit
ba28926219
|
@ -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