Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface { PathNeighbors(node Pather, buf []Pather) []Pather PathNeighborCost(node Pather, to Pather) fix16.T }
Optional user context.
type Goreland ¶
type Goreland struct { }
func (Goreland) RenderPath ¶
RenderPath renders a path on top of a Goreland world.
type Pather ¶
type Pather interface { // PathNeighbors returns the direct neighboring nodes of this node which // can be pathed to. PathNeighbors(ctx Context, buf []Pather) []Pather // PathNeighbourCost calculates the exact movement cost to neighbor nodes. PathNeighborCost(ctx Context, to Pather) fix16.T // PathEstimatedCost is a heuristic method for estimating movement costs // between non-adjacent nodes. PathEstimatedCost(ctx Context, to Pather) fix16.T }
Pather is an interface which allows A* searching on arbitrary objects which can represent a weighted graph.
type Search ¶
type Search struct {
// contains filtered or unexported fields
}
Search is an object representing the current search state.
type Truck ¶
type Truck struct {
// X and Y are the coordinates of the truck.
X, Y int
// contains filtered or unexported fields
}
A Truck is a Truck in a grid which implements Grapher.
func (*Truck) PathEstimatedCost ¶
PathEstimatedCost uses Manhattan distance to estimate orthogonal distance between non-adjacent nodes.
func (*Truck) PathNeighborCost ¶
PathNeighborCost returns the cost of the tube leading to Truck.
Click to show internal directories.
Click to hide internal directories.