aboutsummaryrefslogtreecommitdiff
path: root/src/court.mjs
diff options
context:
space:
mode:
authorKaran Jayachandra <karan.jayachandra@nxp.com>2025-11-14 17:15:13 +0100
committerKaran Jayachandra <karan.jayachandra@nxp.com>2025-11-14 17:15:13 +0100
commit27b3a8f4fe5f6259983a7bcf44e7e987f8e19e09 (patch)
tree02ce6df25efe337f2dc94d45a83149038f44fba5 /src/court.mjs
parente4b599e57e076bef7caa8f5825bbca17540b571d (diff)
Simplified the file structure
Diffstat (limited to 'src/court.mjs')
-rw-r--r--src/court.mjs32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/court.mjs b/src/court.mjs
deleted file mode 100644
index d85f05e..0000000
--- a/src/court.mjs
+++ /dev/null
@@ -1,32 +0,0 @@
-import { Court } from "./data";
-import { Manager } from "./utils.mjs";
-
-export class CourtManager extends Manager {
- maxCourtCount = 12;
-
- constructor() {
- super();
- console.log("Loading court data.");
- let tempCourt = new Court();
- let data = JSON.parse(localStorage.getItem(tempCourt.description));
- if (data === null || data.length != this.maxCourtCount) {
- this.generate();
- return;
- }
- for (let i = 0; i < this.maxCourtCount; i++) {
- let id = Number(data[i].id);
- let status = Boolean(Number(data[i].status));
- this.data.push(new Court(id, status));
- }
- console.log("Loaded " + this.data.length + " courts.");
- this.render();
- }
- generate() {
- for (let i = 0; i < this.maxCourtCount; i++) {
- this.data.push(new Court(i, true));
- }
- console.log("Generated data for " + this.data.length + " courts");
- this.store();
- this.render();
- }
-}