Package megamek.common.loaders
Class MapSetup
java.lang.Object
megamek.common.loaders.MapSetup
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionMapSetup()Deprecated, for removal: This API element is subject to removal in a future version.MapSetup(MapSettings mapSettings) -
Method Summary
Modifier and TypeMethodDescriptionintintintintstatic MapSetupload(InputStream is) Returns a MapSetup loaded from the given InputStream.static voidsave(OutputStream os, MapSettings mapSettings) Retrieves the map setup from the given mapSettings and saves the map setup to the given OutputStream.
-
Constructor Details
-
MapSetup
-
MapSetup
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
load
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
-