public override PieceMove GetMoveTo(Position position) { var moveShift = position - Position; if (moveShift == this.LongMove.Shift && InnerPieceDecorator.ValidateNewMove(LongMove) && CanLongMove()) { return(longMove); } return(Piece.GetMoveTo(position)); }
public override bool ValidateNewMove(PieceMove move) { if (!InnerPieceDecorator.ValidateNewMove(move)) { return(false); } if (move.MoveTypes.Contains(MoveType.Move) && move.Shift == LongMove.Shift) { return(CanLongMove()); } return(true); }
public override bool ValidateNewMove(PieceMove move) { if (!InnerPieceDecorator.ValidateNewMove(move)) { return(false); } var pieceAtDestination = Board.GetPiece(Position + move.Shift); var containsMove = move.MoveTypes.Contains(MoveType.Kill); if (pieceAtDestination != null && pieceAtDestination.Color != Color && !containsMove) { return(false); } if ((pieceAtDestination == null || pieceAtDestination.Color == Color) && containsMove) { return(false); } return(true); }
public override bool ValidateNewMove(PieceMove move) { return InnerPieceDecorator.ValidateNewMove(move) && isProtectedPieceSafeAfterMove(move); }