Ejemplo n.º 1
0
        public IHttpActionResult GetMove(string botName, MoveRequest request)
        {
            var    botKey = request.State.GameId + request.Player;
            IRobot robot  = BotRegistry.GetBot(botName, botKey);

            if (robot != null)
            {
                try
                {
                    var moves = robot.GetMoves(request);
                    return(Ok(moves));
                }
                catch (Exception ex)
                {
                    return(BadRequest(ex.Message));
                }
            }
            return(BadRequest("Could not find bot named " + botName));
        }