Class MazeLayout
java.lang.Object
dev.despical.mazeengine.core.MazeLayout
Stores an immutable logical cell graph with entrance and exit portals.
One byte per cell records cardinal passage bits. Constructor input and returned passage arrays are copied so callers cannot mutate the graph after publication. External portals describe boundary openings and are separate from the internal connections used by graph statistics.
Breadth-first distances support shortest routes, the entrance-to-exit solution, and cached guide routing. Route arrays contain both endpoints. The layout stores no world coordinates or block states; geometry and origin are supplied separately when interpreting it in the world.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordIdentifies a boundary cell and the side opening to the outside. -
Constructor Summary
ConstructorsConstructorDescriptionMazeLayout(int width, int depth, byte[] passages, MazeLayout.Portal entrance, MazeLayout.Portal exit) -
Method Summary
-
Constructor Details
-
MazeLayout
public MazeLayout(int width, int depth, byte[] passages, MazeLayout.Portal entrance, MazeLayout.Portal exit)
-
-
Method Details
-
width
public int width() -
depth
public int depth() -
size
public int size() -
entrance
-
exit
-
passages
public byte[] passages() -
open
-
neighbor
-
distances
public int[] distances(int start) -
solution
public int[] solution() -
route
public int[] route(int start, int target) -
route
public int[] route(int start, int[] distance) -
deadEnds
public int deadEnds()
-