Package megamek

Class MegaMek

java.lang.Object
megamek.MegaMek

public class MegaMek extends Object
This is the primary MegaMek class.
  • Constructor Details

    • MegaMek

      public MegaMek()
  • Method Details

    • main

      public static void main(String... args)
    • setOriginProject

      public static void setOriginProject(String originProject)
      Sets the origin project to the given String. The origin project is the one whose main() method has been executed to arrive here. Therefore, this method should only be called from any of the main() methods. Used for logging purposes.
      Parameters:
      originProject - The origin project name, e.g. MMLConstants.PROJECT_NAME
    • getOriginProject

      public static String getOriginProject()
      The origin project name, i.e. the project whose main() method was executed to arrive here. As this is only a project name and not necessarily set, it should be used only for logging purposes.
      Returns:
      The name of the origin project, typically either of (MM/MML/MHQ)Constants.PROJECT_NAME
    • initializeLogging

      public static void initializeLogging(String originProject)
    • getMMPreferences

      public static SuitePreferences getMMPreferences()
    • getMMOptions

      public static MMOptions getMMOptions()
    • getMemoryUsed

      public static String getMemoryUsed()
      This function returns the memory used in the heap (heap memory - free memory).
      Returns:
      memory used in kB
    • getUnderlyingInformation

      public static String getUnderlyingInformation(String originProject)
      Parameters:
      originProject - the project that launched MegaMek
      Returns:
      the underlying information for this launch of MegaMek
    • getUnderlyingInformation

      public static String getUnderlyingInformation(String originProject, String currentProject)
      Parameters:
      originProject - the launching project
      currentProject - the currently described project
      Returns:
      the underlying information for this launch
    • getBuildDate

      @Nullable public static LocalDateTime getBuildDate()
    • getQuickSaveFile

      public static File getQuickSaveFile()
    • initializeSuiteGraphicalSetups

      public static void initializeSuiteGraphicalSetups(String currentProject)
      This is used to initialize suite-wide graphical setups.
      Parameters:
      currentProject - the currently described project