Versions in this module Expand all Collapse all v1 v1.1.0 May 9, 2026 Changes in this version + func HexFlatTopCellSize(width float64) floats.Size + func HexFlatTopIsometricPixelPerfectCellSize(width float64) floats.Size + func HexPointyTopCellSize(width float64) floats.Size + func HexPointyTopIsometricPixelPerfectCellSize(width float64) floats.Size + func IsometricPixelPerfectRectCellSize(width float64) floats.Size + func IsometricRectCellSize(width float64) floats.Size + func RectCellSize(width float64) floats.Size v1.0.1 May 6, 2026 Changes in this version + var CardinalDirections = [4]ints.Vector + var DiagonalDirections = [4]ints.Vector + var Directions = [8]ints.Vector + var HexFlatTop = &Transform + var HexGridOpts hexGridOptions + var HexPointyTop = &Transform + var LayoutOpts layoutOptions + var RectGridOpts rectGridOptions + var SquareFlat = &Transform + var SquareIsometric = &Transform + func DistanceTo(from, to ints.Point, system System) int + func NeighborOffset(system System, direction Direction) ints.Vector + func NeighborOffsets(system System) []ints.Vector + type Array struct + func Arr[T any](size ints.Size) Array[T] + func (a Array[T]) Clear() + func (a Array[T]) Clone() Array[T] + func (a Array[T]) Fill(value T) + func (a Array[T]) Get(index ints.Point) *T + func (a Array[T]) Has(index ints.Point) bool + func (a Array[T]) Height() int + func (a Array[T]) Iter() iter.Seq[ints.Point] + func (a Array[T]) Iter2() iter.Seq2[ints.Point, *T] + func (a Array[T]) Len() int + func (a Array[T]) Set(index ints.Point, value T) + func (a Array[T]) Size() ints.Size + func (a Array[T]) Width() int + type Cell struct + func (c Cell[T]) Bounds() floats.Rectangle + func (c Cell[T]) Center() floats.Point + func (c Cell[T]) DistanceTo(to ints.Point) int + func (c Cell[T]) Get() *T + func (c Cell[T]) Index() ints.Point + func (c Cell[T]) Neighbors() []ints.Point + func (c Cell[T]) PathTo(to ints.Point, valid ValidFunc[T], cost CostFunc[T]) []*Cell[T] + func (c Cell[T]) Polygon() floats.RegularPolygon + func (c Cell[T]) Range(n int, valid ValidFunc[T]) []ints.Point + func (c Cell[T]) Set(value T) + func (c Cell[T]) Size() floats.Size + func (c Cell[T]) Valid() bool + type CostFunc func(current, next *Cell[T]) float64 + type Direction int + const E + const N + const NE + const NW + const S + const SE + const SW + const W + func (d Direction) Opposite() Direction + func (d Direction) String() string + type Grid struct + func NewGrid[T any](layout Layout, distance func(from, to ints.Point) int, ...) *Grid[T] + func NewHexagonFlatTopGrid[T any](size ints.Size, hexSize floats.Size, opts ...HexGridOption) *Grid[T] + func NewHexagonPointyTopGrid[T any](size ints.Size, hexSize floats.Size, opts ...HexGridOption) *Grid[T] + func NewIsometricRectGrid[T any](grid ints.Size, size floats.Size, opts ...RectGridOption) *Grid[T] + func NewRectGrid[T any](grid ints.Size, size floats.Size, opts ...RectGridOption) *Grid[T] + func (g *Grid[T]) AStar(start, goal ints.Point, valid ValidFunc[T], cost CostFunc[T]) []ints.Point + func (g *Grid[T]) At(point floats.Point) *Cell[T] + func (g *Grid[T]) Bounds() floats.Rectangle + func (g *Grid[T]) BreadthFirstSearch(start, goal ints.Point, valid ValidFunc[T]) []ints.Point + func (g *Grid[T]) BreadthFirstSearchField(start ints.Point, valid ValidFunc[T]) map[ints.Point]ints.Point + func (g *Grid[T]) CellBounds() floats.Size + func (g *Grid[T]) CellHeight() float64 + func (g *Grid[T]) CellSpacing() floats.Size + func (g *Grid[T]) CellWidth() float64 + func (g *Grid[T]) Clear() + func (g *Grid[T]) Clone() *Grid[T] + func (g *Grid[T]) Distance(from, to ints.Point) int + func (g *Grid[T]) Fill(value T) + func (g *Grid[T]) Get(index ints.Point) *Cell[T] + func (g *Grid[T]) GreedyBestFirstSearch(start, goal ints.Point, valid ValidFunc[T]) []ints.Point + func (g *Grid[T]) Has(index ints.Point) bool + func (g *Grid[T]) Height() int + func (g *Grid[T]) IndexAt(point floats.Point) ints.Point + func (g *Grid[T]) Iter(config *IterConfig) iter.Seq[*Cell[T]] + func (g *Grid[T]) Path(from, to ints.Point, valid ValidFunc[T], cost CostFunc[T]) []*Cell[T] + func (g *Grid[T]) Range(index ints.Point, n int, valid ValidFunc[T]) []ints.Point + func (g *Grid[T]) Set(index ints.Point, value T) + func (g *Grid[T]) Size() ints.Size + func (g *Grid[T]) UniformCostSearch(start, goal ints.Point, valid ValidFunc[T], cost CostFunc[T]) []ints.Point + func (g *Grid[T]) UniformCostSearchField(start ints.Point, valid ValidFunc[T], cost CostFunc[T]) map[ints.Point]ints.Point + func (g *Grid[T]) Width() int + type HexGridOption func(*hexGridOptions) + type IterConfig struct + Bounds floats.Rectangle + ColsDouble bool + RowsDouble bool + type Layout struct + func NewLayout(t *Transform, opts ...LayoutOption) Layout + func (l Layout) Add(change floats.Vector) Layout + func (l Layout) AlignTopLeft() Layout + func (l Layout) Bounds() floats.Rectangle + func (l Layout) CellBounds() floats.Size + func (l Layout) CellPolygon(index ints.Point) floats.RegularPolygon + func (l Layout) CellSpacing() floats.Size + func (l Layout) FromPoint(point floats.Point) ints.Point + func (l Layout) MoveTo(origin floats.Point) Layout + func (l Layout) Resize(size floats.Size) Layout + func (l Layout) Size() ints.Size + func (l Layout) ToPoint(index ints.Point) floats.Point + func (l Layout) With(opts ...LayoutOption) Layout + type LayoutOption func(*Layout) + type Point ints.Point + func Pt(x, y int) Point + func (p Point) DistanceTo(to ints.Point, system System) int + func (p Point) FieldOfView(candidates []ints.Point, blocking []ints.Point) []ints.Point + func (p Point) HasLineOfSight(target ints.Point, blocking []ints.Point) bool + func (p Point) Neighbors(system System) []ints.Point + func (p Point) Point() ints.Point + func (p Point) Range(n int) []ints.Point + type RectGridOption func(*rectGridOptions) + type System int + const Cardinal + const Diagonal + type Transform struct + func NewTransform(sides int, orientation geom.Orientation, toPoint, fromPoint floats.Matrix, ...) *Transform + type ValidFunc func(current *Cell[T]) bool + type ValidIndexFunc func(index ints.Point) bool v1.0.0 May 6, 2026