private static ArrayList<BoardLocation>  getDestsBasedOnRangeAndDirections(GameBoard gameboard, BoardLocation origin, Direction[] directions, int range, PlayerName player){
    BoardLocation nextDestination;
    ArrayList<BoardLocation> destinations = new ArrayList<BoardLocation>();
    
    for (Direction dir : directions){
      nextDestination = origin;
      for (int distance = 1; distance <=range; distance++) {
        nextDestination = stepInDirection(nextDestination, player, dir);
        if (nextDestination != null){
          
           Piece target = gameboard.getPieceAtLocation(nextDestination);

          if (target==null) {
            destinations.add(nextDestination);  
          } else if(target.getOwner()!=player){
            destinations.add(nextDestination);
            break;
          } else {
            break;
          }
        } else break;
      }
    }
    return destinations;
  }