Documentation ¶
Index ¶
- Constants
- type CountCost
- type CountWeight
- type Graph
- func (graph *Graph) Clear()
- func (graph *Graph) GetAttr(x, y int) byte
- func (graph *Graph) GetDimension() (int, int)
- func (graph *Graph) GetMultiPath() []Path
- func (graph *Graph) GetPath() Path
- func (graph *Graph) GetPathTiles(path Path) string
- func (graph *Graph) GetSinglePathTiles() string
- func (graph *Graph) GetSingleSteps() int
- func (graph *Graph) GetSteps(path Path) int
- func (graph *Graph) GetTarget() (*Point, *Point)
- func (graph *Graph) GetTiles() string
- func (graph *Graph) GetTilesWithTarget() string
- func (graph *Graph) Search() bool
- func (graph *Graph) SearchMulti() bool
- func (graph *Graph) SetAttr(x, y int, attr byte)
- func (graph *Graph) SetCountCost(count CountCost)
- func (graph *Graph) SetCountWeight(count CountWeight)
- func (graph *Graph) SetNeighbor(neighbor Neighbor)
- func (graph *Graph) SetStringTiles(strtile string)
- func (graph *Graph) SetTarget(sx, sy, ex, ey int)
- type Neighbor
- type Neighbor4
- type Neighbor8
- type Path
- type PathList
- type Point
- type SimpleCost
- type SimpleWeight
- type Tile
Constants ¶
const ( // SKIP skip set attr. used by SetStringTiles SKIP = byte('*') // PLAIN point can be arrived to PLAIN = byte('.') // BLOCK point can not be arrived to BLOCK = byte('x') // START the start point START = byte('s') // END the end point END = byte('e') // PATH not contains start and end. PATH = byte('o') )
AttributeEnum 属性类型
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountWeight ¶
CountWeight count weight interface
type Graph ¶
type Graph struct { Tiles [][]*Tile // contains filtered or unexported fields }
Graph Astar struct
func (*Graph) GetDimension ¶
GetDimension get dimension info
func (*Graph) GetMultiPath ¶
GetMultiPath get multi the astar path of same cost
func (*Graph) GetPathTiles ¶ added in v0.10.3
GetPathTiles get the string of tiles map info
func (*Graph) GetSinglePathTiles ¶ added in v0.10.3
GetSinglePathTiles get the string of tiles map info
func (*Graph) GetSingleSteps ¶
GetSingleSteps result == len(pathlist[0]) - 1
func (*Graph) GetTiles ¶ added in v0.10.3
GetTiles get astar map info not contain target(start, end)
func (*Graph) GetTilesWithTarget ¶ added in v0.10.3
GetTilesWithTarget get astar map info with target
func (*Graph) SearchMulti ¶
SearchMulti astar search multi path
func (*Graph) SetCountCost ¶
SetCountCost use the function different cost
func (*Graph) SetCountWeight ¶
func (graph *Graph) SetCountWeight(count CountWeight)
SetCountWeight use the function different weight
func (*Graph) SetNeighbor ¶
SetNeighbor use the function different directions
func (*Graph) SetStringTiles ¶
SetStringTiles if want some tile do nothing, can use SKIP.