Documentation ¶
Index ¶
- type Grid
- func (g *Grid[T]) At(x, y int) T
- func (g *Grid[T]) AtPos(pos Vector2D[int]) T
- func (g *Grid[T]) Clear(item T)
- func (g *Grid[T]) Clone() Grid[T]
- func (g *Grid[T]) ColAt(x int) []T
- func (g *Grid[T]) Dump() string
- func (g *Grid[T]) Height() int
- func (g *Grid[T]) InsertCol(x int, newCol []T)
- func (g *Grid[T]) InsertRow(y int, newRow []T)
- func (g *Grid[T]) RowAt(y int) []T
- func (g *Grid[T]) SetAt(x, y int, item T)
- func (g *Grid[T]) SetAtPos(position Vector2D[int], item T)
- func (g *Grid[T]) Width() int
- type Vector2D
- func (v Vector2D[T]) Add(dir Vector2D[T]) Vector2D[T]
- func (v Vector2D[T]) InBounds(x1, y1, x2, y2 T) bool
- func (v Vector2D[T]) ManhattanDistance(otherPos Vector2D[T]) T
- func (v Vector2D[T]) ModWrap(width T, height T) Vector2D[T]
- func (v Vector2D[T]) OutOfBounds(x1, y1, x2, y2 T) bool
- func (v Vector2D[T]) Reverse() Vector2D[T]
- func (v Vector2D[T]) RotateLeft() Vector2D[T]
- func (v Vector2D[T]) RotateRight() Vector2D[T]
- func (v Vector2D[T]) ScalarProduct(n T) Vector2D[T]
- type Vector3D
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Vector2D ¶
type Vector2D[T constraints.Signed] struct { X, Y T }
func East ¶
func East[T constraints.Signed]() Vector2D[T]
func North ¶
func North[T constraints.Signed]() Vector2D[T]
func South ¶
func South[T constraints.Signed]() Vector2D[T]
func West ¶
func West[T constraints.Signed]() Vector2D[T]
func (Vector2D[T]) ManhattanDistance ¶
func (Vector2D[T]) OutOfBounds ¶
func (Vector2D[T]) RotateLeft ¶
func (Vector2D[T]) RotateRight ¶
func (Vector2D[T]) ScalarProduct ¶
Click to show internal directories.
Click to hide internal directories.