game: add: scoreboard

This commit is contained in:
2024-02-21 11:04:20 +01:00
parent 576dcb312a
commit dea718320c
4 changed files with 35 additions and 16 deletions

View File

@ -9,15 +9,25 @@ import { Client } from "../Client.js";
class Game
{
/**
* @param {Client} client
* @param {Client} client
* @param {CallableFunction} update_goal
*/
constructor(client, id)
constructor(client, id, update_goal)
{
/**
* @type {Client}
*/
this.client = client;
/**
* @type {Number}
*/
this.id = id;
/**
* @type {CallableFunction}
*/
this.update_goal = update_goal;
}
/**
@ -153,6 +163,8 @@ class Game
this._receive_ball(data);
else if (data.detail === "init_game")
this._init_game(data);
else if (data.detail === "goal")
this.update_goal(data);
}
_init_game(data)