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:
48
src/main/java/StevenDimDoors/experimental/MazeDesign.java
Normal file
48
src/main/java/StevenDimDoors/experimental/MazeDesign.java
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user