Class MapGenerator

java.lang.Object
de.tum.cit.ase.editor.utlis.MapGenerator

public class MapGenerator extends Object
The MapGenerator class is responsible for generating, saving, importing, and validating maps.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    exportMap(Map map, com.badlogic.gdx.files.FileHandle exportFile)
    Exports a Map object to a specified file.
    static void
    exportMap(Map map, com.badlogic.gdx.files.FileHandle exportFile, boolean validate)
     
    static Map
    importMap(com.badlogic.gdx.files.FileHandle mapFile)
    Imports a map from a file and converts it into a Map object.
    static void
    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
    Validates an exported map by checking for check specified in EditorConfig.

    Methods inherited from class java.lang.Object

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

    • MapGenerator

      public MapGenerator()
  • Method Details

    • saveMapProject

      public static void saveMapProject(com.badlogic.gdx.files.FileHandle mapFile, Map mapToSave)
      Saves a map project to a specified file.
      Parameters:
      mapFile - The FileHandle representing the file to save the map project to.
      mapToSave - The Map object to save.
      Throws:
      InvalidMapFile - if the map is invalid.
    • validateExport

      public static void validateExport(Map map)
      Validates an exported map by checking for check specified in EditorConfig.
      Parameters:
      map - The Map object to validate.
      Throws:
      InvalidMapFile - If the map is invalid.
    • loadMapIntoGame

      public static void loadMapIntoGame(Map map) throws MapLoadingException
      Loads a map into the game.
      Parameters:
      map - The Map object representing the map to be loaded.
      Throws:
      MapLoadingException - if an error occurs while loading the map.
    • importMap

      public static Map importMap(com.badlogic.gdx.files.FileHandle mapFile)
      Imports a map from a file and converts it into a Map object.
      Parameters:
      mapFile - The FileHandle representing the file to import the map from.
      Returns:
      The imported Map object.
    • readMapProject

      public static Map readMapProject(com.badlogic.gdx.files.FileHandle mapFile)
      Reads a map project file and converts it into a Map object.
      Parameters:
      mapFile - The FileHandle representing the file to read the map project from.
      Returns:
      The Map object representing the map project.
    • exportMap

      public static void exportMap(Map map, com.badlogic.gdx.files.FileHandle exportFile)
      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)