Exemplo n.º 1
0
        public void TestCreate()
        {
            GoodMoves goods = new GoodMoves();
            CandidateMovesAllSorted moves = new CandidateMovesAllSorted(goods, 0);

            Assert.IsNotNull(moves);
        }
Exemplo n.º 2
0
        public void TestCreate()
        {
            GoodMoves goods = new GoodMoves();
            CandidateMovesSelective moveFinder = new CandidateMovesSelective(goods, 0);

            Assert.IsNotNull(moveFinder);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the HexGame class, with a board size
        /// </summary>
        /// <param name="boardSize">size of the board</param>
        public HexGame(int boardSize)
        {
            this.board = new HexBoard(boardSize);
            IPathLengthFactory pathLengthFactory = new PathLengthAStarFactory();

            this.xPathLength = pathLengthFactory.CreatePathLength(this.board);
            this.yPathLength = pathLengthFactory.CreatePathLength(this.board);
            this.goodMoves   = new GoodMoves();
            this.goodMoves.DefaultGoodMoves(boardSize, 5);
        }
Exemplo n.º 4
0
        private static Minimax MakeMinimaxForBoard(HexBoard board)
        {
            GoodMoves       goodMoves            = new GoodMoves();
            ICandidateMoves candidateMovesFinder = new CandidateMovesAll();

            Minimax result = new Minimax(board, goodMoves, candidateMovesFinder);

            result.GenerateDebugData = true;

            return(result);
        }
Exemplo n.º 5
0
        public void CountOneMoveTest()
        {
            GoodMoves goods = new GoodMoves();
            CandidateMovesAllSorted moveFinder = new CandidateMovesAllSorted(goods, 0);
            HexBoard testBoard = new HexBoard(BoardSize);

            testBoard.PlayMove(5, 5, true);

            IEnumerable <Location> moves = moveFinder.CandidateMoves(testBoard, 0);

            Assert.AreEqual(BoardCellCount - 1, moves.Count());
        }
Exemplo n.º 6
0
 public CandidateMovesSelective(GoodMoves goodMoves, int cellsPlayedCount)
 {
     this.goodMoves        = goodMoves;
     this.cellsPlayedCount = cellsPlayedCount;
 }
Exemplo n.º 7
0
 public void TearDown()
 {
     this.goodMoves = null;
 }
Exemplo n.º 8
0
 public void SetUp()
 {
     this.goodMoves = new GoodMoves();
 }
Exemplo n.º 9
0
 public CandidateMovesAllSorted(GoodMoves goodMoves, int cellsPlayedCount)
 {
     this.goodMoves        = goodMoves;
     this.cellsPlayedCount = cellsPlayedCount;
 }