astar

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsThrough

func IsThrough(sx, sy, tx, ty int32, walkAble func(x, y int32) bool) bool

func IsThroughBorder

func IsThroughBorder(sx, sy, tx, ty int32, walkAbleBorder func(x, y int32, c int) int) bool

Types

type AStar

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

type GridConfig

type GridConfig interface {
	XYI32WalkAble(x, y int32) bool
	XYI32WalkAbleBorder(x, y int32, c int) int
	GetWidth() int32
	GetHeight() int32
	GridType(gridIdx int32) (gridType int16, g int16) // g = 1 or 3
}

type MapStatus

type MapStatus interface {
	GetAStarCache() *AStar
	SetAStarCache(star *AStar)
	GetGridConfig() GridConfig
}

type ReturnType

type ReturnType int32
const (
	ASTAR_SAME_POS ReturnType = iota + 1
	ASTAR_FOUNDED
	ASTAR_UNREACHABLE
)
func Search(maps MapStatus, x, y, tx, ty float32) (ReturnType, []int16)

Jump to

Keyboard shortcuts

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