game: add: goal statistic

This commit is contained in:
2024-02-26 17:11:31 +01:00
parent 8f1979bd21
commit 066a2a9c81
15 changed files with 335 additions and 82 deletions

View File

@ -8,12 +8,12 @@ class Player
* @param {Number} id
* @param {Game} game
* @param {Segment} rail
* @param {Number} nb_goal
* @param {[Number]} score
* @param {Number} position
* @param {Boolean} is_connected
* @param {String} username
*/
constructor(game, id, username, rail, nb_goal, position, is_connected)
constructor(game, id, username, score, rail, position, is_connected)
{
/**
* @type {Game}
@ -36,9 +36,9 @@ class Player
this.position = position;
/**
* @type {Number}
* @type {[Number]}
*/
this.nb_goal = nb_goal;
this.score = score;
/**
* @type {Segment}
@ -102,7 +102,7 @@ class Player
this.is_connected = data.is_connected;
this.id = data.user_id;
this.position = data.position.position ;
this.nb_goal = data.nb_goal;
this.score = data.score;
this.rail = this.rail.from_json(data.rail);
this.username = data.username;