Reduced Floor Doorways

Added code to minimize the number of doorways that involve dropping
through the floor. Added a DisjointSet class as part of the
implementation. I also split the maze construction process into two
classes (MazeDesigner and MazeBuilder) to make it clearer.
This commit is contained in:
SenseiKiwi
2013-12-29 21:31:10 -04:00
parent 22ab4e3639
commit cee4005513
5 changed files with 396 additions and 103 deletions

View File

@@ -0,0 +1,48 @@
package StevenDimDoors.experimental;
import java.util.ArrayList;
public class MazeDesign
{
private PartitionNode root;
private DirectedGraph<PartitionNode, DoorwayData> rooms;
private ArrayList<IGraphNode<PartitionNode, DoorwayData>> cores;
public MazeDesign(PartitionNode root, DirectedGraph<PartitionNode, DoorwayData> rooms,
ArrayList<IGraphNode<PartitionNode, DoorwayData>> cores)
{
this.root = root;
this.rooms = rooms;
this.cores = cores;
}
public PartitionNode getRootPartition()
{
return root;
}
public DirectedGraph<PartitionNode, DoorwayData> getRoomGraph()
{
return rooms;
}
public ArrayList<IGraphNode<PartitionNode, DoorwayData>> getCoreNodes()
{
return cores;
}
public int width()
{
return root.width();
}
public int height()
{
return root.height();
}
public int length()
{
return root.length();
}
}