Add a method for resetting the game

This commit is contained in:
Manuel Thalmann 2022-12-13 11:05:20 +01:00
parent 63bfb5375e
commit ba28926219
No known key found for this signature in database
GPG key ID: 5FD9AD3CCDDBD27B

View file

@ -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.
*/