Class BasicCaveGenerator

java.lang.Object
squidpony.squidgrid.mapping.BasicCaveGenerator
All Implemented Interfaces:
IDungeonGenerator

public class BasicCaveGenerator
extends Object
implements IDungeonGenerator
  • Field Details

  • Constructor Details

  • Method Details

    • generate

      public char[][] generate()
      Generates a dungeon or other map 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 wall and '.' representing a bare floor, but beyond that, anything could be present in the char array.
      Specified by:
      generate in interface IDungeonGenerator
      Returns:
      a 2D char array representing some kind of map, probably using standard conventions for walls/floors
    • getDungeon

      public char[][] getDungeon()
      Gets the most recently-produced dungeon 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 IDungeonGenerator.
      Specified by:
      getDungeon in interface IDungeonGenerator
      Returns:
      the most recently-produced dungeon/map as a 2D char array