aboutsummaryrefslogtreecommitdiff
path: root/src/data.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.js')
-rw-r--r--src/data.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/data.js b/src/data.js
index 3e133ee..f1cf7c9 100644
--- a/src/data.js
+++ b/src/data.js
@@ -1,8 +1,8 @@
class Switch {
- constructor(id, status) {
+ constructor(id, description, status) {
this.id = id;
this.status = typeof status !== "undefined" ? status : false;
- this.description = this.constructor.name;
+ this.description = description;
this.name = this.description + " " + (id + 1);
}
toggle() {
@@ -22,13 +22,13 @@ class Switch {
export class Court extends Switch {
constructor(id, status) {
- super(id, status);
+ super(id, "Court", status);
}
}
export class Regular extends Switch {
constructor(id, status, level, games, firstName, lastName) {
- super(id, status);
+ super(id, "Regular", status);
this.level = typeof level !== "undefined" ? level : 1;
this.games = typeof games !== "undefined" ? games : 0;
this.firstName =
@@ -49,7 +49,7 @@ export class Guest extends Switch {
categoryCount = 3;
constructor(id, status, games) {
- super(id, status);
+ super(id, "Guest", status);
const categoryId = Math.floor(id / this.maxCount) || 0;
this.level = guestCategories[categoryId].level;
this.games = typeof games !== "undefined" ? games : 0;
@@ -83,7 +83,7 @@ export class Team {
export class Game extends Switch {
constructor(id, status, teamOne, teamTwo) {
- super(id, status);
+ super(id, "Game", status);
this.teamOne = teamOne;
this.teamTwo = teamTwo;
}