private static FourInARowMove Common(String[] input, IGameAlgorithm algorithm, IGameFactory gameFactory) { FourInARowState state = PrepareState(input); IGameFactory factory = gameFactory; IGameLogic logic = factory.CreateLogic(); IGameAlgorithm alg = algorithm; Int32 res = factory.CreateStateEvaluator().Evaluate(state, GamePlayer.PlayerMax); return((FourInARowMove)alg.FindBestMove(state, GamePlayer.PlayerMax)); }
public MiniMaxWithAlfaBetaPrunningB(Int32 depth, IGameFactory gameFactory) { if (depth < 1) { throw new ArgumentOutOfRangeException("depth"); } if (null == gameFactory) { throw new ArgumentNullException("gameFactory"); } _depth = depth; _gameFactory = gameFactory; _gameLogic = gameFactory.CreateLogic(); _stateEvaluator = gameFactory.CreateStateEvaluator(); }
public MiniMaxAlgorithmImproved(Int32 depth, IGameFactory gameFactory, Boolean useParallel) { if (depth < 1) { throw new ArgumentOutOfRangeException("depth"); } if (null == gameFactory) { throw new ArgumentNullException("gameFactory"); } _useParallel = useParallel; _depth = depth; _gameFactory = gameFactory; _gameLogic = gameFactory.CreateLogic(); _stateEvaluator = gameFactory.CreateStateEvaluator(); }