Class Xygum
- All Implemented Interfaces:
Generator
public class Xygum extends java.lang.Object implements Generator
Although this is a relatively efficient pathfinder, and one that's more than capable of performing exactly as expected, this pathfinder can sometimes generate paths with way too many points. As a result, certain types of followers will be incredibly slow to follow the path.
This is really where a lot of the "magic" happens. Although Pathfinder on its own handles a lot of stuff - positional tracking, multithreading, path management, path generation, path following, all of that cool stuff - most of the actual path generation is outsourced to another library.
As a result, the code in this class is all tested and working extremely well. Any issues with path generation that can't be resolved by opening an issue on Pathfinder should be reported. As Xavier's library is hosted and built on my GitHub, I can make any changes that would fix the code.
- Since:
- 0.1.0
- Author:
- Colin Robertson
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
Xygum.Finder
Wrapper class for the Theta Star Grid Finder.private static class
Xygum.FinderConfiguration
The pathfinder's configuration class.static class
Xygum.Finders
The available finders.private class
Xygum.Nav
Navigation class, used in... -
Field Summary
Fields Modifier and Type Field Description private PathfinderConfig
config
The Pathfinder library's configuration.private Xygum.Finder
finder
The finder itself.private Xygum.Nav
nav
Navigation utilities. -
Constructor Summary
Constructors Constructor Description Xygum(PathfinderConfig config, Xygum.Finders f)
Create a new instance of the path generation wrapper. -
Method Summary
Modifier and Type Method Description private me.wobblyyyy.edt.DynamicArray<org.xguzm.pathfinding.grid.GridCell>
getCellPath(Point start, Point end)
Get a path that's notated in PathfindingCore's default GridCell implementation.me.wobblyyyy.edt.DynamicArray<Point>
getCoordinatePath(Point start, Point end)
Get a path, from a start coordinate to an end coordinate, that's directly readable by our implementation of the pathfinding system.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
config
The Pathfinder library's configuration. -
finder
The finder itself.
-
-
Constructor Details
-
Xygum
Create a new instance of the path generation wrapper.- Parameters:
config
- the Pathfinder library's configuration class.
-
-
Method Details
-
getCellPath
private me.wobblyyyy.edt.DynamicArray<org.xguzm.pathfinding.grid.GridCell> getCellPath(Point start, Point end)Get a path that's notated in PathfindingCore's default GridCell implementation.All of the pathfinding work done here is handled by the Finder class.
- Parameters:
start
- the start position (notated as a double coordinate).end
- the end position (notated as a double coordinate).- Returns:
- a list of scaled-up (1440x1440)
GridCell
instances. - See Also:
getCellPath(Point, Point)
-
getCoordinatePath
Get a path, from a start coordinate to an end coordinate, that's directly readable by our implementation of the pathfinding system.- Specified by:
getCoordinatePath
in interfaceGenerator
- Parameters:
start
- the start coordinate.end
- the end coordinate.- Returns:
- a group, composed of individual Point items.
- See Also:
getCellPath(Point, Point)
-