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 intgetHeight()ArrayList<Coord>getLastPath()IRNGgetRng()intgetWidth()ArrayList<Coord>line(int startX, int startY, int endX, int endY)ArrayList<Coord>line(Coord start, Coord end)voidreinitialize()Called automatically during construction, this sets up a random maze as aDefaultGraphso a path can be found.voidsetRng(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 aDefaultGraphso 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
-