예제 #1
0
        public override IEnumerable <Square> GetAvailableMoves(Board board)
        {
            var currentSquare  = board.FindPiece(this);
            var availableMoves = new List <Square>();

            availableMoves.AddRange(LateralPiece.GetLateralMoves(currentSquare, board));
            availableMoves.AddRange(DiagonalPiece.GetDiagonalMoves(currentSquare, board));

            var invalidMoves = NotPawn.TakeOnlyOpponent(availableMoves, board);

            foreach (var move in invalidMoves)
            {
                availableMoves.Remove(move);
            }
            return(availableMoves);
        }
예제 #2
0
 public override IEnumerable <Square> GetAvailableMoves(Board board)
 {
     return(LateralPiece.GetLateralMoves(board.FindPiece(this), board));
 }