Documentation
¶
Index ¶
- Variables
- type Direction
- type Grid
- func (g *Grid[T]) Copied() *Grid[T]
- func (g *Grid[T]) Copy(gg *Grid[T])
- func (g *Grid[T]) CopyTo(gg *Grid[T])
- func (g *Grid[T]) Equal(f *Grid[T]) bool
- func (g *Grid[T]) Get(p Position) T
- func (g *Grid[T]) Getrc(row, col int) T
- func (g *Grid[T]) Nearest(from Position, dirs []Direction, ok func(Position) bool, dir ...Direction) *Position
- func (g *Grid[T]) OutBound(pos Position) bool
- func (g *Grid[T]) Range(action RangeAction[T])
- func (g *Grid[T]) Set(p Position, val T)
- func (g *Grid[T]) SetData(data [][]T)
- type Position
- type RangeAction
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Up = Direction{Dx: 0, Dy: -1} Down = Direction{Dx: 0, Dy: 1} Left = Direction{Dx: -1, Dy: 0} Right = Direction{Dx: 1, Dy: 0} UpLeft = Direction{Dx: -1, Dy: -1} UpRight = Direction{Dx: 1, Dy: -1} DownLeft = Direction{Dx: -1, Dy: 1} DownRight = Direction{Dx: 1, Dy: 1} NormalDirections = []Direction{Up, Down, Left, Right} AllDirections = []Direction{Up, Down, Left, Right, UpLeft, UpRight, DownLeft, DownRight} )
Functions ¶
This section is empty.
Types ¶
type Grid ¶
type Grid[T comparable] struct { // contains filtered or unexported fields }
func New ¶
func New[T comparable](rows, cols int) *Grid[T]
func NewWithString ¶ added in v0.2.1
func (*Grid[T]) Range ¶
func (g *Grid[T]) Range(action RangeAction[T])
type RangeAction ¶
type RangeAction[T comparable] func(pos Position, char T, isLineEnd bool) (end bool)
Click to show internal directories.
Click to hide internal directories.