Class BattleshipView

java.lang.Object
battleship.view.BattleshipView

public class BattleshipView extends Object
  • Constructor Details

    • BattleshipView

      public BattleshipView(int sizeHorizontal, int sizeVertical)
  • Method Details

    • getHorizontalSize

      public int getHorizontalSize()
      Returns:
      horizontal size of the ocean.
    • getVerticalSize

      public int getVerticalSize()
      Returns:
      vertical size of the ocean.
    • printOcean

      public void printOcean(String additionalInfo)
      Print ocean view to console
      Parameters:
      additionalInfo - additional info to display in the end
    • updateOcean

      public String updateOcean(AttackReport report)
      Update ocean view after the last attack
      Parameters:
      report - report of attack
      Returns:
      String
    • printMainMenu

      public static void printMainMenu()
      Print the main menu
    • printModeMenu

      public static void printModeMenu(String mode)
      Print the Mode choosing menu
      Parameters:
      mode - mode to chose
    • clearConsole

      public static void clearConsole()
      Clearing console (don't work in IDE)
    • printHelp

      public void printHelp()
      Print help menu.
    • recoverShips

      public void recoverShips(List<Point> points)
      Recover ships cell views
      Parameters:
      points - list of points to recover