Add toString override for debugging purposes.
This commit is contained in:
parent
661f52292e
commit
b0117ed6fe
1 changed files with 10 additions and 1 deletions
|
|
@ -19,4 +19,13 @@ class Game {
|
|||
host: is_host
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
let players: string[] = [];
|
||||
for (var player in this.#_players) {
|
||||
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(',')})`;
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue