game: add: scoreboard
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user