Versions in this module Expand all Collapse all v1 v1.3.1 Sep 12, 2023 Changes in this version + type Direction byte + const East + const North + const NorthEast + const NorthWest + const South + const SouthEast + const SouthWest + const West + func (v Direction) String() string + type Grid struct + Size Point + func NewGrid(width, height int16) *Grid[string] + func NewGridOf(width, height int16) *Grid[T] + func ReadFile(filename string) (grid *Grid[T], err error) + func ReadFrom(src io.Reader) (grid *Grid[T], err error) + func (m *Grid[T]) Around(from Point, distance uint32, costOf costFn, fn func(Point, Tile[T])) + func (m *Grid[T]) At(x, y int16) (Tile[T], bool) + func (m *Grid[T]) Each(fn func(Point, Tile[T])) + func (m *Grid[T]) MaskAt(x, y int16, tile, mask Value) + func (m *Grid[T]) MergeAt(x, y int16, merge func(Value) Value) + func (m *Grid[T]) Neighbors(x, y int16, fn func(Point, Tile[T])) + func (m *Grid[T]) Path(from, to Point, costOf costFn) ([]Point, int, bool) + func (m *Grid[T]) View(rect Rect, fn func(Point, Tile[T])) *View[T] + func (m *Grid[T]) Within(nw, se Point, fn func(Point, Tile[T])) + func (m *Grid[T]) WriteAt(x, y int16, tile Value) + func (m *Grid[T]) WriteFile(filename string) error + func (m *Grid[T]) WriteTo(dst io.Writer) (n int64, err error) + type Point struct + X int16 + Y int16 + func At(x, y int16) Point + func (p Point) Add(p2 Point) Point + func (p Point) DistanceTo(other Point) uint32 + func (p Point) Divide(p2 Point) Point + func (p Point) DivideScalar(s int16) Point + func (p Point) Equal(other Point) bool + func (p Point) Integer() uint32 + func (p Point) Move(direction Direction) Point + func (p Point) MoveBy(direction Direction, n int16) Point + func (p Point) Multiply(p2 Point) Point + func (p Point) MultiplyScalar(s int16) Point + func (p Point) String() string + func (p Point) Subtract(p2 Point) Point + func (p Point) Within(nw, se Point) bool + func (p Point) WithinRect(box Rect) bool + func (p Point) WithinSize(size Point) bool + type Rect struct + Max Point + Min Point + func NewRect(left, top, right, bottom int16) Rect + func (r *Rect) Contains(p Point) bool + func (r *Rect) Intersects(box Rect) bool + func (r *Rect) Size() Point + type Tile struct + func (c Tile[T]) Add(v T) + func (c Tile[T]) Count() (count int) + func (c Tile[T]) Del(v T) + func (c Tile[T]) Mask(tile, mask Value) Value + func (c Tile[T]) Merge(merge func(Value) Value) Value + func (c Tile[T]) Range(fn func(T) error) error + func (c Tile[T]) Value() Value + func (c Tile[T]) Write(tile Value) + type Update struct + Add T + Del T + New Value + Old Value + type Value = uint32 + type View struct + Grid *Grid[T] + Inbox chan Update[T] + func (v *View[T]) At(x, y int16) (Tile[T], bool) + func (v *View[T]) Close() error + func (v *View[T]) Each(fn func(Point, Tile[T])) + func (v *View[T]) MergeAt(x, y int16, tile, mask Value) + func (v *View[T]) MoveAt(nw Point, fn func(Point, Tile[T])) + func (v *View[T]) MoveBy(x, y int16, fn func(Point, Tile[T])) + func (v *View[T]) Resize(box Rect, fn func(Point, Tile[T])) + func (v *View[T]) WriteAt(x, y int16, tile Value)