public void AddGame() { Game g = new Game(); GameStore.AddGame(g); Assert.AreEqual(g, GameStore.Instance.Games[g.Id]); }
public Game Create() { Game g = new Game(); GameStore.AddGame(g); return(g); }
private static void AddDummyGames() { var player1 = new Player("", "Alfred"); GameStore.AddGame(player1, 0, 0); var player2 = new Player("", "Britney"); var game = GameStore.AddGame(player2, 0, 0); game.Status = GameStatus.NormalTurn; }
public async Task CreateGame(string playerName, int answerSeconds, int challengeSeconds) { Player admin = new Player(Context.ConnectionId, playerName); Game game = GameStore.AddGame(admin, answerSeconds, challengeSeconds); await Groups.AddToGroupAsync(Context.ConnectionId, game.Code); await Clients.Caller.GameUpdated(game); await Clients.Group(GameList).GameListUpdated(GameStore.GetGames()); }
public IActionResult CreateGame(string playerName, int answerSeconds, int challengeSeconds) { Player admin = new Player("", playerName); GameStore.AddGame(admin, answerSeconds, challengeSeconds); // TODO Subscribe caller to game update // TODO _gameClient.GameCreated(_games.Values.ToList()); return(Ok(admin.ConnectionId)); }