nav

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 6 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
}

func NewAStar

func NewAStar(landUse *res.LandUse) AStar

func (*AStar) FindPath

func (a *AStar) FindPath(start, target comp.Tile) ([]comp.Tile, bool)

type PriorityQueue

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

A PriorityQueue implements heap.Interface and holds Items.

func NewPriorityQueue

func NewPriorityQueue() PriorityQueue

func (*PriorityQueue) Contains

func (h *PriorityQueue) Contains(tile comp.Tile) bool

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() any

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x any)

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

func (*PriorityQueue) Update

func (pq *PriorityQueue) Update(tile comp.Tile, priority int)

Update modifies the priority and value of an Item in the queue.

type Score

type Score struct {
	Tile  comp.Tile
	Score int
}

type TileHeap

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

An TileHeap is a min-heap of ints.

func NewTileMap

func NewTileMap() TileHeap

func (*TileHeap) Contains

func (h *TileHeap) Contains(tile comp.Tile) bool

func (TileHeap) Len

func (h TileHeap) Len() int

func (TileHeap) Less

func (h TileHeap) Less(i, j int) bool

func (*TileHeap) Pop

func (h *TileHeap) Pop() any

func (*TileHeap) Push

func (h *TileHeap) Push(x any)

func (TileHeap) Swap

func (h TileHeap) Swap(i, j int)

Jump to

Keyboard shortcuts

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