Package de.tum.cit.ase.editor.utlis
Class MapGenerator
java.lang.Object
de.tum.cit.ase.editor.utlis.MapGenerator
The MapGenerator class is responsible for generating, saving, importing, and validating maps.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Exports a Map object to a specified file.static void
static Map
importMap
(com.badlogic.gdx.files.FileHandle mapFile) Imports a map from a file and converts it into a Map object.static void
loadMapIntoGame
(Map map) Loads a map into the game.static Map
readMapProject
(com.badlogic.gdx.files.FileHandle mapFile) Reads a map project file and converts it into a Map object.static void
saveMapProject
(com.badlogic.gdx.files.FileHandle mapFile, Map mapToSave) Saves a map project to a specified file.static void
validateExport
(Map map) Validates an exported map by checking for check specified inEditorConfig
.
-
Constructor Details
-
MapGenerator
public MapGenerator()
-
-
Method Details
-
saveMapProject
Saves a map project to a specified file.- Parameters:
mapFile
- TheFileHandle
representing the file to save the map project to.mapToSave
- TheMap
object to save.- Throws:
InvalidMapFile
- if the map is invalid.
-
validateExport
Validates an exported map by checking for check specified inEditorConfig
.- Parameters:
map
- TheMap
object to validate.- Throws:
InvalidMapFile
- If the map is invalid.
-
loadMapIntoGame
Loads a map into the game.- Parameters:
map
- TheMap
object representing the map to be loaded.- Throws:
MapLoadingException
- if an error occurs while loading the map.
-
importMap
Imports a map from a file and converts it into a Map object.- Parameters:
mapFile
- TheFileHandle
representing the file to import the map from.- Returns:
- The imported Map object.
-
readMapProject
Reads a map project file and converts it into a Map object.- Parameters:
mapFile
- TheFileHandle
representing the file to read the map project from.- Returns:
- The
Map
object representing the map project.
-
exportMap
Exports a Map object to a specified file.- Parameters:
map
- The Map object to export.exportFile
- The FileHandle representing the file to export the Map object to.
-
exportMap
public static void exportMap(Map map, com.badlogic.gdx.files.FileHandle exportFile, boolean validate)
-