From e18aae4ccc49a6c91032e8719281460ccc63346a Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 9 Jan 2022 23:37:03 +0100 Subject: Create an environment object The environment object holds basically all the information about the state of all the games, statistics regarding games, etc. The `minimumMoves` and `averageMoves` variables start out at infinity just so that we have an easy way to check if they've actually been set yet or not, since they won't be properly set before any games have even been played. --- draughts/environment.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 draughts/environment.js diff --git a/draughts/environment.js b/draughts/environment.js new file mode 100644 index 0000000..0745ca0 --- /dev/null +++ b/draughts/environment.js @@ -0,0 +1,10 @@ +/* An object representing the complete environment. It holds all the games as well as some statistics + * to be displayed on the splash screen. + */ +const environment = { + minimumMoves: Infinity, + averageMoves: Infinity, + games: [] +} + +module.exports = environment -- cgit v1.2.3