aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <thomasvoss@live.com> 2022-01-09 23:37:03 +0100
committerThomas Voss <thomasvoss@live.com> 2022-01-09 23:37:03 +0100
commite18aae4ccc49a6c91032e8719281460ccc63346a (patch)
tree62e9b56cdc72a05b695346f243f6f28eae883f2e
parentb3ce2adff90b344cdd9e6ff5e5c7f0d1194eabbf (diff)
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.
-rw-r--r--draughts/environment.js10
1 files changed, 10 insertions, 0 deletions
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