public void OutCome()
        {
            ProcessedGame game;

            GameDatabase.Games.TryPeek(out game);
            var frame         = SourceGame.Frames[5];
            var matchingFrame = game.Frames[5];

            var result = SlitherPlayer.PlayGame("test", frame, 250);

            Assert.Equal(matchingFrame.Outcome, result.PredictedOutcome);
        }
Exemple #2
0
 public GameDecision PlayGame(string id, int millisecondsToAction, [FromBody] SlitherFrame slitherFrame)
 {
     if (ActiveGameDatabase.ActiveGames.ContainsKey(id))
     {
         ActiveGameDatabase.ActiveGames[id].Frames.Add(slitherFrame);
     }
     return(SlitherPlayer.PlayGame(id, slitherFrame, millisecondsToAction));
 }
        public void Benchmark()
        {
            var frame = SourceGame.Frames[5];

            Stopwatch stopwatch = Stopwatch.StartNew();

            var result = SlitherPlayer.PlayGame("test", frame, 250);

            stopwatch.Stop();
            Debug.WriteLine(stopwatch.ElapsedMilliseconds);
        }