@Beta public class MapModule extends java.lang.Object implements java.lang.Comparable<MapModule>, java.io.Serializable
ModularMapGenerator
need improvement to be actually usable,
but it might be a while before there's a clear pathway towards how they can be improved.
Modifier and Type | Field and Description |
---|---|
java.util.ArrayList<Coord> |
bottomDoors |
int |
category |
int[][] |
environment
The room/cave/corridor/wall status for each cell of this section of map.
|
java.util.ArrayList<Coord> |
leftDoors |
char[][] |
map
The contents of this section of map.
|
Coord |
max
The maximum point on the bounding rectangle of the room, including walls.
|
Coord |
min
The minimum point on the bounding rectangle of the room, including walls.
|
java.util.ArrayList<Coord> |
rightDoors |
java.util.ArrayList<Coord> |
topDoors |
GreasedRegion |
validDoors
Stores Coords just outside the contents of the MapModule, where doors are allowed to connect into this.
|
Constructor and Description |
---|
MapModule() |
MapModule(char[][] map)
Constructs a MapModule given only a 2D char array as the contents of this section of map.
|
MapModule(char[][] map,
GreasedRegion validDoors,
Coord min,
Coord max)
Constructs a MapModule from the given arguments without modifying them, copying map without changing its size,
copying validDoors, and using the same min and max (which are immutable, so they can be reused).
|
MapModule(MapModule other)
Copies another MapModule and uses it to construct a new one.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MapModule o) |
MapModule |
flip(boolean flipLeftRight,
boolean flipUpDown) |
MapModule |
rotate(int turns)
Rotates a copy of this MapModule by the given number of 90-degree turns.
|
public char[][] map
public int[][] environment
public GreasedRegion validDoors
public Coord min
public Coord max
public java.util.ArrayList<Coord> leftDoors
public java.util.ArrayList<Coord> rightDoors
public java.util.ArrayList<Coord> topDoors
public java.util.ArrayList<Coord> bottomDoors
public int category
public MapModule()
public MapModule(char[][] map)
map
- the 2D char array that contains the contents of this section of mappublic MapModule(char[][] map, GreasedRegion validDoors, Coord min, Coord max)
map
- the 2D char array that contains the contents of this section of map; will be copied exactlyvalidDoors
- a Coord array that stores viable locations to place doors in map; will be clonedmin
- the minimum Coord of this MapModule's bounding rectanglemax
- the maximum Coord of this MapModule's bounding rectanglepublic MapModule(MapModule other)
other
- an already-constructed MapModule that this will copypublic MapModule rotate(int turns)
turns
- the number of 90 degree turns to adjust this bypublic MapModule flip(boolean flipLeftRight, boolean flipUpDown)
Copyright © Eben Howard 2012–2022. All rights reserved.