Function reference
Dungeon()
Returns a new Dungeon (ScriptGroup) object.
Dungeon::generate([size=15[, specials=""]])
Generates rooms until the total number of rooms is size. When done, if specials is not empty, it will iterate over it's fields and replace leaf rooms with each individual field. Returns true when both operations succeed, false otherwise.
E.g. Dungeon::generate(30, "boss" TAB "shop") will generate 30 rooms, then place a boss room and a shop room.
If the dungeon already has some rooms generated (or set), you will need to call Dungeon::reset() before this method.
Dungeon::setRoom(x, y, type)
Creates a room at the given coordinates if there is no room there, or, using the already existing room, sets its type to the given type.
The first thing the generator does is run Dungeon::setRoom(0, 0, "start").
Dungeon::reset()
Removes all rooms and room[x, y] mappings from the object, making it ready for generating again.
Dungeon::visualize()
For debugging purposes, this function iterates over all rooms to get the boundaries of the dungeon and displays them as a top-down view in the console.
Dungeon::getCandidates()
Used internally for room generation - returns all points in the dungeon where a room is allowed to be placed.
Dungeon::getLeaves()
Used internally for special room placing - returns all points in the room which contain leaf rooms.
Dungeon::getNeighbors(x, y[, rooms])
Used internally for Dungeon::getCandidates - returns all points around the coordinates that do not contain a room, unless rooms is true, in which case it returns all points around the coordinates that do contain a room.