public void Should_GenerateOneMoveNorthWest()
        {
            // execute
            ChessPosition position = _mover.NorthWest(ChessPosition.B1);

            // verify
            Assert.AreEqual(ChessPosition.A2, position);
        }
Esempio n. 2
0
        private ChessPosition GenerateCaptureWest(IBoardState enemyPieces, IChessPieceMover cpm)
        {
            ChessPosition potentialCapture =
                Color == ChessColor.White ? cpm.NorthWest(Location) : cpm.SouthWest(Location);
            bool isPieceAtCaptureLocation = enemyPieces.Contains(potentialCapture);

            return(isPieceAtCaptureLocation ? potentialCapture : ChessPosition.None);
        }
Esempio n. 3
0
        private void GenerateNorthWestMoves(IBoardState boardState, IChessPieceMover cpm)
        {
            ChessPosition nextMove = cpm.NorthWest(Location);

            if (!boardState.Contains(nextMove))
            {
                MoveSet.Add(nextMove);
            }
        }
Esempio n. 4
0
        private void GenerateWestNorthWestMove(IBoardState boardState, IChessPieceMover cpm)
        {
            ChessPosition move = cpm.West(cpm.NorthWest(Location));

            if (!boardState.Contains(move))
            {
                MoveSet.Add(move);
            }
        }
Esempio n. 5
0
        private void GenerateNorthWestCaptures(IBoardState enemyBoardState, IChessPieceMover cpm)
        {
            ChessPosition capture = cpm.NorthWest(Location);

            AddCaptureToCaptureSet(capture, enemyBoardState);
        }
Esempio n. 6
0
 private ChessPosition GenerateThreatenedWest(IChessPieceMover cpm)
 {
     return(Color == ChessColor.White ? cpm.NorthWest(Location) : cpm.SouthWest(Location));
 }