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

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

            Assert.IsNotNull(moveFinder);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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());
        }
Esempio n. 6
0
 public CandidateMovesSelective(GoodMoves goodMoves, int cellsPlayedCount)
 {
     this.goodMoves        = goodMoves;
     this.cellsPlayedCount = cellsPlayedCount;
 }
Esempio n. 7
0
 public void TearDown()
 {
     this.goodMoves = null;
 }
Esempio n. 8
0
 public void SetUp()
 {
     this.goodMoves = new GoodMoves();
 }
 public CandidateMovesAllSorted(GoodMoves goodMoves, int cellsPlayedCount)
 {
     this.goodMoves        = goodMoves;
     this.cellsPlayedCount = cellsPlayedCount;
 }