Class MapSetup

java.lang.Object
megamek.common.loaders.MapSetup
All Implemented Interfaces:
Serializable

public class MapSetup extends Object implements Serializable
A helper class that is used for storing and retrieving map setups in the lobby. MapSetup objects are only used as temporary objects and discarded after loading or saving the setup. The map setup consists of the map size, board size and board names. The board names can include surprise boards with multiple board names and generated boards. No actual hexes are saved, only board names/types. Thus, when loading a map setup with a generated board the resulting board is created again using the random map settings currently in use. And, of course, this generated board is only an example in turn as the actual game board is only created when the game is started.
See Also:
  • Constructor Details

    • MapSetup

      public MapSetup(MapSettings mapSettings)
    • MapSetup

      @Deprecated(since="0.51.0", forRemoval=true) public MapSetup()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • load

      public static MapSetup load(InputStream is) throws jakarta.xml.bind.JAXBException
      Returns a MapSetup loaded from the given InputStream. Throws JAXBExceptions.
      Throws:
      jakarta.xml.bind.JAXBException
    • save

      public static void save(OutputStream os, MapSettings mapSettings) throws jakarta.xml.bind.JAXBException
      Retrieves the map setup from the given mapSettings and saves the map setup to the given OutputStream. Throws JAXBExceptions.
      Throws:
      jakarta.xml.bind.JAXBException
    • getBoardWidth

      public int getBoardWidth()
    • getBoardHeight

      public int getBoardHeight()
    • getMapWidth

      public int getMapWidth()
    • getMapHeight

      public int getMapHeight()
    • getBoards

      public List<String> getBoards()