Example #1
0
 public MoveEvaluator(IBoardAnalyzer boardAnalyzer, IRandomProvider randomProvider, ProtoBoard protoBoard)
 {
     this._boardAnalyzer = boardAnalyzer;
     _randomProvider     = randomProvider;
     this._protoBoard    = protoBoard;
     this._setEvaluators = new List <CoordinateEvaluator>();
 }
Example #2
0
        public void InitializeTests()
        {
            this.Board         = new Game.Data.Contract.Board();
            this.RowController = new RowController();
            this.Recognizer    = new PatternRecognizer(this.Board, this.RowController);
            this.Analyzer      = new BoardAnalyzer(this.Board);
            this.Controller    = new BoardController(this.Board, this.Analyzer, this.Recognizer);
            this.Controller.Initialize();
            this.Player = new Player("Nerzal")
            {
                Color = Colors.White
            };
            this.Player2 = new Player("Wr4thon")
            {
                Color = Colors.Black
            };

            IMovementRules movementRules = new MovementRules(this.Analyzer, this.Board);
            IGameOverRules gameOverRules = new GameOverRules(this.Analyzer);
            IRuleSet       ruleSet       = new RuleSet(movementRules, gameOverRules);
            IHistory       history       = new History();

            this.MillRuleEvaluator = new Evaluator(ruleSet, this.Analyzer);
            IRowController     rowController     = new RowController();
            IPatternRecognizer patternRecognizer = new PatternRecognizer(this.Board, rowController);

            this.GameController = new GameController(this.MillRuleEvaluator, this.Board, history, this.Controller, patternRecognizer, rowController);
        }
Example #3
0
        /// <inheritdoc />
        public Evaluator(IRuleSet rules, IBoardAnalyzer analyzer)
        {
            this.Rules = rules;
            this.Rules.GameOverRules.Initialize();
            this.Rules.MoveValidationRules.Initialize();

            this.BoardAnalyzer = analyzer;
        }
Example #4
0
        public SimpleAi(IGameController controller, IBoardAnalyzer analyzer, IRandomProvider random, IMillRuleEvaluator millRuleEvaluator) : base(controller, analyzer, millRuleEvaluator)
        {
            using (Stream resourceStream = GetType().Assembly.GetManifestResourceStream(GetType().Namespace + ".Board.json")) {
                using (StreamReader sr = new StreamReader(resourceStream)) {
                    string content = sr.ReadToEnd();
                    this._protoBoard = JsonConvert.DeserializeObject <ProtoBoard>(content);
                }
            }

            this._random           = random;
            this._setMoveEvaluator = new MoveEvaluator(this.BoardAnalyzer, random, this._protoBoard);
            this._setMoveEvaluator.Initialize();
        }
Example #5
0
 public void InitializeTests()
 {
     this.Board         = new Game.Data.Contract.Board();
     this.Analyzer      = new BoardAnalyzer(this.Board);
     this.RowController = new RowController();
     this.Recognizer    = new PatternRecognizer(this.Board, this.RowController);
     this.Recognizer.Initialize();
     this.Controller = new BoardController(this.Board, this.Analyzer, this.Recognizer);
     this.Controller.Initialize();
     this.Player = new Player("Nerzal")
     {
         Color = Colors.White
     };
     this.Player2 = new Player("Wr4th0n")
     {
         Color = Colors.Black
     };
 }
Example #6
0
 public TacoCat(IBoardAnalyzer boardAnalyzer, string name)
     : this(boardAnalyzer)
 {
     _name = name;
 }
Example #7
0
 public TacoCat(IBoardAnalyzer boardAnalyzer)
 {
     _analyzer = boardAnalyzer;
 }
Example #8
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="board"></param>
 /// <param name="analyzer"></param>
 /// <param name="recognizer"></param>
 public BoardController(IBoard board, IBoardAnalyzer analyzer, IPatternRecognizer recognizer)
 {
     this.Board       = board;
     this._analyzer   = analyzer;
     this._recognizer = recognizer;
 }
Example #9
0
 public FreeCoordinateSpotter(IBoardAnalyzer boardAnalyzer)
 {
     this._boardAnalyzer = boardAnalyzer;
 }
Example #10
0
 public void AddBoardAnalyzer(IBoardAnalyzer analyzer)
 {
     BoardAnalysisPipeline.Add(analyzer);
 }
Example #11
0
 public OptimusDeep(int depth, IBoardAnalyzer boardAnalyzer, string name)
     : this(depth, boardAnalyzer)
 {
     _name = name;
 }
Example #12
0
 public OptimusDeep(int depth, IBoardAnalyzer boardAnalyzer)
 {
     _analyzer = boardAnalyzer;
     _depth    = depth;
 }
Example #13
0
 /// <inheritdoc />
 public MovementRules(IBoardAnalyzer boardAnalyzer, IBoard board)
 {
     this.BoardAnalyzer = boardAnalyzer;
     this._board        = board;
 }
Example #14
0
 /// <inheritdoc />
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="boardAnalyzer"></param>
 public GameOverRules(IBoardAnalyzer boardAnalyzer)
 {
     this.BoardAnalyzer = boardAnalyzer;
 }
Example #15
0
 public Game(IBoard board, IBoardAnalyzer analyzer, IGameIO io)
 {
     this.board    = board;
     this.analyzer = analyzer;
     this.io       = io;
 }
Example #16
0
 /// <inheritdoc />
 protected AiPlayer(IGameController controller, IBoardAnalyzer analyzer, IMillRuleEvaluator ruleEvaluator) : base("Computer")
 {
     this.GameController = controller;
     this.BoardAnalyzer  = analyzer;
     _ruleEvaluator      = ruleEvaluator;
 }