Package battleship

Class Main

java.lang.Object
battleship.Main

public class Main
extends java.lang.Object
Main class Given arguments are importants, please give attention to parseArgs(String[]) about this
  • Field Summary

    Fields
    Modifier and Type Field Description
    static Game game  
    static View view  
  • Constructor Summary

    Constructors
    Constructor Description
    Main()  
  • Method Summary

    Modifier and Type Method Description
    static void main​(java.lang.String[] args)  
    private static void parseArgs​(java.lang.String[] args)
    Read and parse launch arguments.
    launch arguments need to follow this syntax:

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • view

      public static View view
    • game

      public static Game game
  • Constructor Details

    • Main

      public Main()
  • Method Details

    • main

      public static void main​(java.lang.String[] args)
    • parseArgs

      private static void parseArgs​(java.lang.String[] args) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException

      Read and parse launch arguments.
      launch arguments need to follow this syntax:

      <player1_instance> <player2_instance> [nogui]

      <arg> -> mandatory parameter
      [arg] -> optional parameter
      player_instance values are: "Human" or "Random"
      nogui to launch the game in terminal or nothing to launch in graphical interface

      Parameters:
      args - launch arguments
      Throws:
      java.lang.NoSuchMethodException - reflect exception
      java.lang.IllegalAccessException - reflect exception
      java.lang.reflect.InvocationTargetException - reflect exception
      java.lang.InstantiationException - reflect exception