Class MapGenerator

java.lang.Object
randomGenerators.map.MapGenerator
Direct Known Subclasses:
RandomBinaryMapGenerator, RandomMapGenerator, RandomTextMapGenerator

public abstract class MapGenerator extends Object
This abstract class serves as the base class for map generators. It provides common functionality for generating random maps and managing map files.
  • Field Details

    • mapCount

      public static int mapCount
      The number of generated maps. Used for generating unique map file names.
    • mapCopyCount

      public static int mapCopyCount
      The number of generated copies of the map. Used for generating unique names of copies of one original, unmuted map.
  • Constructor Details

    • MapGenerator

      public MapGenerator()
  • Method Details

    • generateRandomMap

      public abstract String generateRandomMap()
      Generates a random map and returns the file path of the generated map file.
      Returns:
      The file path of the generated map file.
    • generateRandomMapFileName

      public static String generateRandomMapFileName(String extension)
      Generates the name of the map, with the number and the correct extension
      Parameters:
      extension - String that can either be .txt or .bin
      Returns:
      String Full name of the map file.
    • generateRandomMapCopyFileName

      public static String generateRandomMapCopyFileName (String extension)
      Generates the name of the map copy, with the number and the correct extension.
      Parameters:
      extension - String that can either be .txt or .bin
      Returns:
      String Full name of the map copy file.