Adjust string output
This commit is contained in:
parent
bdb7f6fc14
commit
30ee2febcb
1 changed files with 2 additions and 6 deletions
|
|
@ -32,12 +32,8 @@ export class Game {
|
||||||
};
|
};
|
||||||
|
|
||||||
public toString(): string {
|
public toString(): string {
|
||||||
let players: string[] = [];
|
let player_count = Object.keys(this._players).length;
|
||||||
for (var player in this.#players) {
|
return `Game(code=${this.code},players=${player_count})`;
|
||||||
let p: player = this.players[player];
|
|
||||||
players.push(`${player}(host=${p.host},pos=${p.position || 'none'},role=${p.role || 'none'}`);
|
|
||||||
};
|
|
||||||
return `Game(code=${this.code},players=${players.join(',')})`;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public toJSON(): string {
|
public toJSON(): string {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue