gastar

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AStar

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

AStar 采用左上角坐标系

func NewAStar

func NewAStar(width, height int32, canPassFunc func(x, y int32) bool) *AStar

NewAStar 构造函数

func (*AStar) Clear

func (a *AStar) Clear()

Clear 清理

func (*AStar) Find

func (a *AStar) Find(startNode, endNode *Node) []*Node

Find 寻路

type Node

type Node struct {

	// X坐标
	X int32
	// Y坐标
	Y int32
	// contains filtered or unexported fields
}

func NewNode

func NewNode(x, y int32) *Node

NewNode 构造函数

Jump to

Keyboard shortcuts

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