Documentation ¶
Overview ¶
This file is a part of goRo, a library for writing roguelikes. Copyright (C) 2019 Ketchetwahmeegwun T. Southall
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
Constants ¶
const (
MaximumCost = math.MaxUint32
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Path ¶
type Path interface { Compute(oX, oY int, tX, tY int) []Step SetHeuristicsFunc(func(x0, y0 int, x1, y1 int) float64) AllowDiagonals(v bool) }
Path is our interface for paths.
func NewPathAStarFromFunc ¶
func NewPathAStarFromMap ¶
func NewPathFromFunc ¶
func NewPathFromFunc(width, height int, calcFunc func(x int, y int) (cost uint32), algo Algorithm) Path
NewPathFromFunc returns a new pathing map with movement costs calculated from calcFunc.
func NewPathFromMap ¶
NewPathFromMap returns a new pathing map from the given pathMap interface.
type PathAStar ¶
type PathAStar struct {
// contains filtered or unexported fields
}
PathAStar represents a pathing structure for the A* algorithm.
func (*PathAStar) AllowDiagonals ¶
AllowDiagonals sets if diagonal movement is allowed.