示例#1
0
        public IActionResult NewGame()
        {
            // FOR HOSTING REASON: delete the game as soon as the player has won
            // to avoid the number of games from increasing
            if (_gameRegistry.GetGameIds().Count() >= MAX_GAME_COUNT)
            {
                return(BadRequest("A maximum of 10 simulateneous games is supported. Delete some of the games."));
            }

            var game = _gameRegistry.StartNewGame();

            return(Ok(game.Id));
        }