rlgamekit.map.generators
Class Dungeon

java.lang.Object
  extended by rlgamekit.map.generators.AbstractMapGenerator
      extended by rlgamekit.map.generators.Dungeon
All Implemented Interfaces:
MapGenerator

public class Dungeon
extends AbstractMapGenerator

This generator creates a classical rooms and corridor maze. The rooms are positioned in a grid with random deviations.

See Also:
MapGenerator

Constructor Summary
Dungeon(java.lang.String mapPath, java.util.Properties props)
          Creates a new instance of Dungeon.
Dungeon(java.lang.String mapPath, java.lang.String propsfile)
          Creates a new instance of Dungeon.
 
Method Summary
 LayeredMap generate(int width, int height)
          Generate a new map of the "rooms and corridors" type.
 java.util.ArrayList<java.awt.Rectangle> getRooms()
          Get room coordinates and sizes after a map has been generated.
 
Methods inherited from class rlgamekit.map.generators.AbstractMapGenerator
getInt, getInt, getIntegers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dungeon

public Dungeon(java.lang.String mapPath,
               java.lang.String propsfile)
Creates a new instance of Dungeon. Reads settings into variables for use in generate()


Dungeon

public Dungeon(java.lang.String mapPath,
               java.util.Properties props)
Creates a new instance of Dungeon. Reads settings into variables for use in generate()

Method Detail

getRooms

public java.util.ArrayList<java.awt.Rectangle> getRooms()
Get room coordinates and sizes after a map has been generated.

Returns:
A list of room coordinates and sizes

generate

public LayeredMap generate(int width,
                           int height)
Generate a new map of the "rooms and corridors" type.

Parameters:
width - desired map width
height - desired map height
Returns:
the generated map model or null if generation failed.