Package battleship

Interface IShip

All Known Implementing Classes:
Barge, Caravel, Carrack, Frigate, Galleon, Ship

public interface IShip
The interface Ship.
  • Method Details

    • getCategory

      String getCategory()
      Gets category.
      Returns:
      the category
    • getSize

      Integer getSize()
      Gets size.
      Returns:
      the size
    • getPositions

      List<IPosition> getPositions()
      Gets positions.
      Returns:
      the positions
    • getAdjacentPositions

      List<IPosition> getAdjacentPositions()
      Gets positions.
      Returns:
      the adjacent positions
    • getPosition

      IPosition getPosition()
      Gets position.
      Returns:
      the position
    • getBearing

      Compass getBearing()
      Gets bearing.
      Returns:
      the bearing
    • stillFloating

      boolean stillFloating()
      Still floating boolean.
      Returns:
      the boolean
    • getTopMostPos

      int getTopMostPos()
      Gets top most pos.
      Returns:
      the top most pos
    • getBottomMostPos

      int getBottomMostPos()
      Gets bottom most pos.
      Returns:
      the bottom most pos
    • getLeftMostPos

      int getLeftMostPos()
      Gets left most pos.
      Returns:
      the left most pos
    • getRightMostPos

      int getRightMostPos()
      Gets right most pos.
      Returns:
      the right most pos
    • occupies

      boolean occupies(IPosition pos)
      Occupies boolean.
      Parameters:
      pos - the pos
      Returns:
      the boolean
    • tooCloseTo

      boolean tooCloseTo(IShip other)
      Too close to boolean.
      Parameters:
      other - the other
      Returns:
      the boolean
    • tooCloseTo

      boolean tooCloseTo(IPosition pos)
      Too close to boolean.
      Parameters:
      pos - the pos
      Returns:
      the boolean
    • shoot

      void shoot(IPosition pos)
      Shoot.
      Parameters:
      pos - the pos
    • sink

      void sink()
      Sink.