Interface PlaceGenerator

All Known Implementing Classes:
ConnectingMapGenerator, DungeonProcessor, FlowingCaveGenerator, GrowingTreeMazeGenerator, MixedGenerator, PacMazeGenerator, SerpentMapGenerator, SlashMazeGenerator, SymmetryDungeonGenerator, WildernessGenerator, WildernessGenerator.MixedWildernessGenerator

public interface PlaceGenerator
Standardizes an interface for classes that generate 2D char arrays to be used as place maps.
  • Method Summary

    Modifier and Type
    Method
    Description
    char[][]
    Generates a dungeon or other place as a 2D char array.
    int[][]
    Gets the most recently-produced place's environment as a 2D int array, where each int is typically a constant in DungeonTools like DungeonTools.NATURAL_WALL or DungeonTools.ROOM_FLOOR.
    char[][]
    Gets the most recently-produced place as a 2D char array, usually produced by calling generate() or some similar method present in a specific implementation.
  • Method Details

    • generate

      char[][] generate()
      Generates a dungeon or other place as a 2D char array. Any implementation may allow its own configuration and customization of how dungeons are generated, but each must provide this as a sane default. Most implementations should use the convention of '#' representing a blocking cell such as a wall and '.' representing a bare floor, but beyond that, anything could be present in the char array.
      Returns:
      a 2D char array representing some kind of map, probably using standard conventions for walls/floors
    • getPlaceGrid

      char[][] getPlaceGrid()
      Gets the most recently-produced place as a 2D char array, usually produced by calling generate() or some similar method present in a specific implementation. This normally passes a direct reference and not a copy, so you can normally modify the returned array to propagate changes back into this IPlaceGenerator.
      Returns:
      the most recently-produced dungeon/place as a 2D char array
    • getEnvironment

      int[][] getEnvironment()
      Gets the most recently-produced place's environment as a 2D int array, where each int is typically a constant in DungeonTools like DungeonTools.NATURAL_WALL or DungeonTools.ROOM_FLOOR.
      Returns:
      the environment of the most recently-produced place, as a 2D int array