astar

package
v1.18.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAstarPoint

func NewAstarPoint(p *_Point, father *_AstarPoint, end *_AstarPoint) (ap *_AstarPoint)

Types

type Map

type Map struct {
	// contains filtered or unexported fields
}

Map 保存地图的基本信息

func NewMap

func NewMap(charMap []string) (m Map)

func (*Map) PrintMap

func (pointMap *Map) PrintMap(path *SearchRoad)

type OpenList

type OpenList []*_AstarPoint

func (OpenList) Len

func (l OpenList) Len() int

func (OpenList) Less

func (l OpenList) Less(i, j int) bool

func (*OpenList) Pop

func (l *OpenList) Pop() interface{}

func (*OpenList) Push

func (l *OpenList) Push(x interface{})

func (OpenList) Swap

func (l OpenList) Swap(i, j int)

type SearchRoad

type SearchRoad struct {
	TheRoad []*_AstarPoint
	// contains filtered or unexported fields
}

func NewSearchRoad

func NewSearchRoad(startx, starty, endx, endy int, m *Map) *SearchRoad

func (*SearchRoad) FindoutRoad

func (sr *SearchRoad) FindoutRoad() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL