Пример #1
0
            private int Simulate(Move move, int depth)
            {
                SimulationCount++;
                var version      = game.HandleMove(move);
                var updatedScore = game.GetScore();

                if (updatedScore < initialScore - MaxLossTolerance)
                {
                    AbortedSimCount++;
                    game.RevertToVersion(version);
                    return(-1);
                }

                var score = (depth < MaxDepth && game.TurnsRemaining > 0)
               ? Simulate(depth + 1).Item1
               : updatedScore;

                game.RevertToVersion(version);
                return(score);
            }
Пример #2
0
 public Simulation(Game game)
 {
     this.game = game;//.Copy();
     initialScore = game.GetScore();
     initialPlayer = game.GetCurrentPlayer();
 }
Пример #3
0
 public Simulation(Game game)
 {
     this.game     = game;//.Copy();
     initialScore  = game.GetScore();
     initialPlayer = game.GetCurrentPlayer();
 }