grid

package
v0.0.0-...-fe2311f Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnitVectorNorth = UnitVector{Point{0, -1}, 1}
	UnitVectorSouth = UnitVector{Point{0, 1}, 1}
	UnitVectorWest  = UnitVector{Point{-1, 0}, 1}
	UnitVectorEast  = UnitVector{Point{1, 0}, 1}
)

Functions

This section is empty.

Types

type Plane

type Plane[T item] struct {
	// contains filtered or unexported fields
}

func (Plane[T]) All

func (p Plane[T]) All() [][]T

func (*Plane[T]) Col

func (p *Plane[T]) Col(x int) []T

func (Plane[T]) Get

func (p Plane[T]) Get(x, y int) T

func (Plane[T]) Has

func (p Plane[T]) Has(x, y int) bool

func (*Plane[T]) Height

func (p *Plane[T]) Height() int

func (*Plane[T]) Row

func (p *Plane[T]) Row(y int) []T

func (*Plane[T]) Set

func (p *Plane[T]) Set(x, y int, item T)

func (Plane[T]) Sparse

func (p Plane[T]) Sparse() map[int]map[int]T

func (*Plane[T]) Width

func (p *Plane[T]) Width() int

type Point

type Point struct {
	X int
	Y int
}

func (Point) Neighboring

func (p Point) Neighboring(q Point) bool

type UnitVector

type UnitVector Vector

type Vector

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

Jump to

Keyboard shortcuts

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