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); }
public Simulation(Game game) { this.game = game;//.Copy(); initialScore = game.GetScore(); initialPlayer = game.GetCurrentPlayer(); }