Package squidpony.squidmath
Class TwistedLine
java.lang.Object
squidpony.squidmath.TwistedLine
public class TwistedLine extends Object
Like
This uses a similar algorithm to
Created by Tommy Ettinger on 6/26/2020.
WobblyLine
, this generates orthogonally-connected paths of Coord
that meander through an area;
unlike WobblyLine, this won't ever generate paths that cross themselves.
This uses a similar algorithm to
GrowingTreeMazeGenerator
to generate a
fully-connected graph for a given rectangular area, then solves it with
DefaultGraph.findShortestPath(Coord, Coord, ArrayList, Heuristic)
.
Created by Tommy Ettinger on 6/26/2020.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description TwistedLine()
TwistedLine(int width, int height)
TwistedLine(int width, int height, IRNG rng)
-
Method Summary
Modifier and Type Method Description int
getHeight()
ArrayList<Coord>
getLastPath()
IRNG
getRng()
int
getWidth()
ArrayList<Coord>
line(int startX, int startY, int endX, int endY)
ArrayList<Coord>
line(Coord start, Coord end)
void
reinitialize()
Called automatically during construction, this sets up a random maze as aDefaultGraph
so a path can be found.void
setRng(IRNG rng)
-
Field Details
-
Constructor Details
-
TwistedLine
public TwistedLine() -
TwistedLine
-
TwistedLine
-
-
Method Details
-
reinitialize
Called automatically during construction, this sets up a random maze as aDefaultGraph
so a path can be found. You can call this after construction to change the paths this can find. -
line
-
line
-
getWidth
-
getHeight
-
getRng
-
setRng
-
getLastPath
-