public boolean inCell(Cell c) {
        if (cell == null) {
            return false;
        }
        // if given cell equals to start cell of pplaced ship
        if (cell.equals(c)) {
            return true;
            // else check if the given cell occupied with ship
        } else {
            Cell checkCell = c;
            if (direction == Direction.HORIZONTAL) {
                if ((checkCell.getX() >= cell.getX() && checkCell.getX() <= cell.getX() + size)
                        && checkCell.getY() == cell.getY()) {
                    return true;
                } else {
                    return false;
                }
            } else {
                if ((checkCell.getY() >= cell.getY() && checkCell.getY() <= cell.getY() + size)
                        && checkCell.getX() == cell.getX()) {
                    return true;
                } else {
                    return false;
                }
            }
        }
    }