From 6456fae865aae8b2ba398b5f78f2589c93d0643d Mon Sep 17 00:00:00 2001 From: Karan Jayachandra Date: Sun, 9 Nov 2025 11:53:05 +0100 Subject: Working regulars and courts --- court.mjs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 court.mjs (limited to 'court.mjs') diff --git a/court.mjs b/court.mjs new file mode 100644 index 0000000..31f277f --- /dev/null +++ b/court.mjs @@ -0,0 +1,28 @@ +export class Court { + constructor(id) { + this.id = id; + this.name = "Court " + (id + 1); + this.status = true; + } + toggle() { + this.status = !this.status; + this.print(); + } + print() { + let status = this.status ? "active" : "inactive"; + console.log(this.name + " is currently " + status); + } + render() { + let type = this.status ? "" : 'class="outline secondary"'; + return ``; + } +} + +export function generateCourts() { + let courts = []; + const totalCourts = 12; + for (let i = 0; i < totalCourts; i++) { + courts.push(new Court(i)); + } + return courts; +} \ No newline at end of file -- cgit v1.3.1