From 27990fcba5a47252df617db1bc98e2276b326e7e Mon Sep 17 00:00:00 2001 From: jbion Date: Fri, 22 Feb 2019 23:09:40 +0100 Subject: Implement Game start --- frontend/src/models/games.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'frontend/src/models/games.js') diff --git a/frontend/src/models/games.js b/frontend/src/models/games.js index 7a8dfbc7..85aab2df 100644 --- a/frontend/src/models/games.js +++ b/frontend/src/models/games.js @@ -15,6 +15,7 @@ export type SettingsShape = { wonderSidePickMethod: "EACH_RANDOM" | "TODO", pointsPer3Gold: number }; + export type SettingsType = Record; const SettingsRecord: SettingsType = Record({ @@ -32,6 +33,7 @@ const SettingsRecord: SettingsType = Record({ wonderSidePickMethod: 'EACH_RANDOM', pointsPer3Gold: 1, }); + export class Settings extends SettingsRecord {} export type GameState = 'LOBBY' | 'PLAYING'; @@ -43,6 +45,7 @@ export type GameShape = { settings: SettingsType, state: GameState, }; + export type GameType = Record; export type GameMapType = Map; export type GameNormalMapType = { [string]: GameShape }; @@ -55,18 +58,21 @@ const GameRecord: GameType = Record({ settings: new Settings(), state: 'LOBBY', }); + export class Game extends GameRecord {} export type GamesShape = { all: Map, current: string }; + export type GamesType = Record; const GamesRecord: GamesType = Record({ all: new Map(), current: null, }); + export class GamesState extends GamesRecord { addGame(g: GameShape) { const game: Game = new Game(g); -- cgit