Refactored Maze Generation to use RoomData
Rewrote portions of our maze generation code to use RoomData. This provides an object that unifies all room data instead of having it spread across various data structures and linked loosely by hash maps. We'll need this to implement the remaining generation features.
This commit is contained in:
@@ -5,16 +5,12 @@ import java.util.ArrayList;
|
||||
public class MazeDesign
|
||||
{
|
||||
private PartitionNode root;
|
||||
private DirectedGraph<PartitionNode, DoorwayData> rooms;
|
||||
private ArrayList<IGraphNode<PartitionNode, DoorwayData>> cores;
|
||||
private ArrayList<BoundingBox> protectedAreas;
|
||||
private DirectedGraph<RoomData, DoorwayData> layout;
|
||||
|
||||
public MazeDesign(PartitionNode root, DirectedGraph<PartitionNode, DoorwayData> rooms,
|
||||
ArrayList<IGraphNode<PartitionNode, DoorwayData>> cores)
|
||||
public MazeDesign(PartitionNode root, DirectedGraph<RoomData, DoorwayData> layout)
|
||||
{
|
||||
this.root = root;
|
||||
this.rooms = rooms;
|
||||
this.cores = cores;
|
||||
this.layout = layout;
|
||||
}
|
||||
|
||||
public PartitionNode getRootPartition()
|
||||
@@ -22,19 +18,9 @@ public class MazeDesign
|
||||
return root;
|
||||
}
|
||||
|
||||
public DirectedGraph<PartitionNode, DoorwayData> getRoomGraph()
|
||||
public DirectedGraph<RoomData, DoorwayData> getLayout()
|
||||
{
|
||||
return rooms;
|
||||
}
|
||||
|
||||
public ArrayList<IGraphNode<PartitionNode, DoorwayData>> getCoreNodes()
|
||||
{
|
||||
return cores;
|
||||
}
|
||||
|
||||
public ArrayList<BoundingBox> getProtectedAreas()
|
||||
{
|
||||
return protectedAreas;
|
||||
return layout;
|
||||
}
|
||||
|
||||
public int width()
|
||||
|
||||
Reference in New Issue
Block a user