${this.playerOne}
${this.playerTwo}
class Switch { constructor(id, description, status) { this.id = id; this.status = typeof status !== "undefined" ? status : false; this.description = description; this.name = description + " " + (id + 1); } toggle() { this.status = !this.status; this.print(); } print() { let status = this.status ? "active" : "inactive"; console.log(this.name + " is currently " + status); } render() { let color = this.status ? "is-success" : "is-danger"; let type = `class="button ${color}"`; let id = this.description + "_" + this.id; return ``; } } export class Court extends Switch { constructor(id, status) { super(id, "Court", status); } } export class Player extends Switch { constructor(id, status, level, games, name) { super(id, "Regular", status); this.level = typeof level !== "undefined" ? level : 1; this.games = typeof games !== "undefined" ? games : 0; if (typeof name !== "undefined") { this.name = name; } } } const guestCategories = { 0: { description: "Beginner", level: 1 }, 1: { description: "Novice", level: 3 }, 2: { description: "Intermediate", level: 6 }, }; export class Guest extends Switch { maxCount = 6; categoryCount = 3; constructor(id, status, games) { super(id, "Guest", status); const categoryId = Math.floor(id / this.maxCount) || 0; this.level = guestCategories[categoryId].level; this.games = typeof games !== "undefined" ? games : 0; const guestNumber = (id % this.maxCount) + 1; this.name = guestCategories[categoryId].description + " " + guestNumber; } } export class Team { constructor(playerOne, playerTwo) { this.playerOne = playerOne; this.playerTwo = playerTwo; } print() { console.log("Team consists of:"); this.playerOne.print(); this.playerTwo.print(); } render() { return `
${this.playerOne}
${this.playerTwo}
Reserved
` let type = blockedState ? placeHolder : this.teamOne.render() + this.teamTwo.render(); return `Court ${this.id + 1}