Begin implementing toJSON and fromJSON
This commit is contained in:
parent
4b5a05f57b
commit
48c0f995d1
1 changed files with 14 additions and 0 deletions
|
|
@ -107,6 +107,20 @@ export class Game {
|
|||
};
|
||||
|
||||
|
||||
public toJSON() {
|
||||
/**
|
||||
* Returns a JSON representation of the game.
|
||||
*/
|
||||
let players = this.players.map(p => p.toJSON());
|
||||
};
|
||||
|
||||
public static fromJSON() {
|
||||
/**
|
||||
* Converts a JSON object into a Game object
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
public static generateID(length: number): string {
|
||||
/**
|
||||
* Generates a game code with the given length
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue