content: package com.uditagarwal.chess.moves;
  
  import com.uditagarwal.chess.conditions.MoveBaseCondition;
  import com.uditagarwal.chess.conditions.PieceCellOccupyBlocker;
  import com.uditagarwal.chess.conditions.PieceMoveFurtherCondition;
  import com.uditagarwal.chess.model.Board;
  import com.uditagarwal.chess.model.Cell;
  import com.uditagarwal.chess.model.Piece;
  import com.uditagarwal.chess.model.Player;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import static com.uditagarwal.chess.moves.VerticalMoveDirection.*;
  
  
  public class PossibleMovesProviderVertical extends PossibleMovesProvider {
      private VerticalMoveDirection verticalMoveDirection;
  
      public PossibleMovesProviderVertical(int maxSteps, MoveBaseCondition baseCondition,
                                           PieceMoveFurtherCondition moveFurtherCondition, PieceCellOccupyBlocker baseBlocker,
                                           VerticalMoveDirection verticalMoveDirection) {
          super(maxSteps, baseCondition, moveFurtherCondition, baseBlocker);
          this.verticalMoveDirection = verticalMoveDirection;
      }
  
  
      @Override
      protected List<Cell> possibleMovesAsPerCurrentType(Piece piece, Board board, List<PieceCellOccupyBlocker> additionalBlockers, Player player) {
          List<Cell> result = new ArrayList<>();
          if (this.verticalMoveDirection == UP || this.verticalMoveDirection == BOTH) {
              result.addAll(findAllNextMoves(piece, board::getUpCell, board, additionalBlockers, player));
          }
          if (this.verticalMoveDirection == DOWN || this.verticalMoveDirection == BOTH) {
              result.addAll(findAllNextMoves(piece, board::getDownCell, board, additionalBlockers, player));
          }
          return result;
      }
  }
  