public class TwistedLine
extends java.lang.Object
WobblyLine
, this generates orthogonally-connected paths of Coord
that meander through an area;
unlike WobblyLine, this won't ever generate paths that cross themselves.
GrowingTreeMazeGenerator
to generate a
fully-connected graph for a given rectangular area, then solves it with
DefaultGraph.findShortestPath(Coord, Coord, ArrayList, Heuristic)
.
Modifier and Type | Field and Description |
---|---|
DefaultGraph |
graph |
java.util.ArrayList<Coord> |
lastPath |
IRNG |
rng |
Constructor and Description |
---|
TwistedLine() |
TwistedLine(int width,
int height) |
TwistedLine(int width,
int height,
IRNG rng) |
Modifier and Type | Method and Description |
---|---|
int |
getHeight() |
java.util.ArrayList<Coord> |
getLastPath() |
IRNG |
getRng() |
int |
getWidth() |
java.util.ArrayList<Coord> |
line(Coord start,
Coord end) |
java.util.ArrayList<Coord> |
line(int startX,
int startY,
int endX,
int endY) |
void |
reinitialize()
Called automatically during construction, this sets up a random maze as a
DefaultGraph so a path can be
found. |
void |
setRng(IRNG rng) |
public IRNG rng
public final DefaultGraph graph
public final java.util.ArrayList<Coord> lastPath
public TwistedLine()
public TwistedLine(int width, int height)
public TwistedLine(int width, int height, IRNG rng)
public void reinitialize()
DefaultGraph
so a path can be
found. You can call this after construction to change the paths this can find.public java.util.ArrayList<Coord> line(int startX, int startY, int endX, int endY)
public int getWidth()
public int getHeight()
public IRNG getRng()
public void setRng(IRNG rng)
public java.util.ArrayList<Coord> getLastPath()
Copyright © Eben Howard 2012–2022. All rights reserved.