Documentation ¶
Index ¶
- type Pathfinder
- func (p *Pathfinder) AvoidAdditionalPoint(x int, y int)
- func (p *Pathfinder) DisableCornerCutting()
- func (p *Pathfinder) DisableDiagonals()
- func (p *Pathfinder) EnableCornerCutting()
- func (p *Pathfinder) EnableDiagonals()
- func (p *Pathfinder) FindPath(startX int, startY int, endX int, endY int) ([]*Point, error)
- func (p *Pathfinder) RemoveAdditionalPointCost(x int, y int)
- func (p *Pathfinder) RemoveAllAdditionalPointCosts()
- func (p *Pathfinder) SetAcceptableTiles(t []int)
- func (p *Pathfinder) SetAdditionalPointCost(x int, y int, cost float64)
- func (p *Pathfinder) SetGrid(grid [][]int)
- func (p *Pathfinder) StopAvoidingAdditionalPoint(x int, y int)
- func (p *Pathfinder) StopAvoidingAllAdditionalPoints()
- type Point
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pathfinder ¶
type Pathfinder struct {
// contains filtered or unexported fields
}
Pathfinder represents a single instance of a pathfinding configuration
func NewPathfinder ¶
func NewPathfinder() *Pathfinder
NewPathfinder returns a new instance of a pathfinder
func (*Pathfinder) AvoidAdditionalPoint ¶
func (p *Pathfinder) AvoidAdditionalPoint(x int, y int)
AvoidAdditionalPoint avoids a particular point on the grid regardless of whether or not it is an acceptable tile
func (*Pathfinder) DisableCornerCutting ¶
func (p *Pathfinder) DisableCornerCutting()
DisableCornerCutting disables corner cutting in diagonal movement
func (*Pathfinder) DisableDiagonals ¶
func (p *Pathfinder) DisableDiagonals()
DisableDiagonals disables diagonals on the Pathfinder
func (*Pathfinder) EnableCornerCutting ¶
func (p *Pathfinder) EnableCornerCutting()
EnableCornerCutting enables corner cutting in diagonal movement
func (*Pathfinder) EnableDiagonals ¶
func (p *Pathfinder) EnableDiagonals()
EnableDiagonals enables diagonals on the Pathfinder
func (*Pathfinder) FindPath ¶
FindPath finds a path Returns a slice of points which consists the starting point up to the end point inclusively
func (*Pathfinder) RemoveAdditionalPointCost ¶
func (p *Pathfinder) RemoveAdditionalPointCost(x int, y int)
RemoveAdditionalPointCost removes the additional cost for a particular point
func (*Pathfinder) RemoveAllAdditionalPointCosts ¶
func (p *Pathfinder) RemoveAllAdditionalPointCosts()
RemoveAllAdditionalPointCosts removes all additional point costs
func (*Pathfinder) SetAcceptableTiles ¶
func (p *Pathfinder) SetAcceptableTiles(t []int)
SetAcceptableTiles sets a list of tiles which are deemed acceptable to pass through
func (*Pathfinder) SetAdditionalPointCost ¶
func (p *Pathfinder) SetAdditionalPointCost(x int, y int, cost float64)
SetAdditionalPointCost sets the an additional cost for a particular point Overrides the cost from SetTileCost
func (*Pathfinder) SetGrid ¶
func (p *Pathfinder) SetGrid(grid [][]int)
SetGrid sets the grid of the Pathfinder
func (*Pathfinder) StopAvoidingAdditionalPoint ¶
func (p *Pathfinder) StopAvoidingAdditionalPoint(x int, y int)
StopAvoidingAdditionalPoint stops avoiding a particular point on the grid
func (*Pathfinder) StopAvoidingAllAdditionalPoints ¶
func (p *Pathfinder) StopAvoidingAllAdditionalPoints()
StopAvoidingAllAdditionalPoints stops avoiding all additional points on the grid