grid

package
v0.0.0-...-dc3ba52 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 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 Cell

type Cell[V any] struct {
	Value V
	// contains filtered or unexported fields
}

func (Cell[V]) ID

func (c Cell[V]) ID() int

func (Cell[V]) Neighbours

func (c Cell[V]) Neighbours() []*Cell[V]

func (Cell[V]) X

func (c Cell[V]) X() int

func (Cell[V]) Y

func (c Cell[V]) Y() int

type Grid

type Grid[V any] struct {
	// contains filtered or unexported fields
}

func NewGrid

func NewGrid[V any](values [][]V, allowDiagonalNeighbours bool) *Grid[V]

func (Grid[V]) CellAt

func (g Grid[V]) CellAt(x int, y int) *Cell[V]

func (Grid[V]) CellAtBottomRight

func (g Grid[V]) CellAtBottomRight() *Cell[V]

func (Grid[V]) CellAtTopLeft

func (g Grid[V]) CellAtTopLeft() *Cell[V]

func (Grid[V]) Each

func (g Grid[V]) Each(callback func(c *Cell[V]) bool)

func (Grid[V]) Size

func (g Grid[V]) Size() int

Jump to

Keyboard shortcuts

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