Documentation ¶
Index ¶
- type Coordinate
- func (c Coordinate) Adjacent() []Coordinate
- func (c Coordinate) Down() Coordinate
- func (c Coordinate) IsZero() bool
- func (c Coordinate) Left() Coordinate
- func (c Coordinate) ManhattanDistance(co Coordinate) int
- func (c Coordinate) Right() Coordinate
- func (c Coordinate) String() string
- func (c Coordinate) Surrounding() []Coordinate
- func (c Coordinate) Up() Coordinate
- type Coordinate3D
- func (c Coordinate3D) Add(to Coordinate3D) Coordinate3D
- func (c Coordinate3D) ApplyRotation(x, y, z int) Coordinate3D
- func (c Coordinate3D) Diff(to Coordinate3D) Coordinate3D
- func (c Coordinate3D) ManhattanDistance(to Coordinate3D) int
- func (c Coordinate3D) String() string
- func (c Coordinate3D) Sub(to Coordinate3D) Coordinate3D
- type CoordinateArray
- type CoordinateItem
- type Cuboid
- func (c Cuboid) Contains(co Cuboid) bool
- func (c Cuboid) Coordinates() []Coordinate3D
- func (c Cuboid) IsOverlapping(co Cuboid) bool
- func (c Cuboid) Overlapping(co Cuboid) *Cuboid
- func (c Cuboid) Size() int
- func (c Cuboid) String() string
- func (c Cuboid) Subdivide(co Cuboid) ([]Cuboid, *Cuboid, []Cuboid)
- type IntMap
- func (m IntMap) Adjacent(c Coordinate) []Coordinate
- func (m IntMap) ArrPos(c Coordinate) int
- func (m IntMap) ArraySize() int
- func (m IntMap) At(c Coordinate) int
- func (m IntMap) Coordinates() []Coordinate
- func (m IntMap) CopyWith(fn func(val int) int) IntMap
- func (m IntMap) Exists(c Coordinate) bool
- func (m *IntMap) Inc(c Coordinate)
- func (m IntMap) Length() int
- func (m *IntMap) Set(c Coordinate, val int)
- func (m IntMap) String() string
- func (m IntMap) Surrounding(c Coordinate) []Coordinate
- func (m IntMap) WithPadding(n, e, s, w int) IntMap
- type PriorityQueue
- type Rotation3D
- type RotationDirection
- type RotationFacing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coordinate ¶
func (Coordinate) Adjacent ¶
func (c Coordinate) Adjacent() []Coordinate
func (Coordinate) Down ¶
func (c Coordinate) Down() Coordinate
func (Coordinate) IsZero ¶
func (c Coordinate) IsZero() bool
func (Coordinate) Left ¶
func (c Coordinate) Left() Coordinate
func (Coordinate) ManhattanDistance ¶
func (c Coordinate) ManhattanDistance(co Coordinate) int
func (Coordinate) Right ¶
func (c Coordinate) Right() Coordinate
func (Coordinate) String ¶
func (c Coordinate) String() string
func (Coordinate) Surrounding ¶
func (c Coordinate) Surrounding() []Coordinate
func (Coordinate) Up ¶
func (c Coordinate) Up() Coordinate
type Coordinate3D ¶
func NewCoordinate3D ¶
func NewCoordinate3D(s string) Coordinate3D
func (Coordinate3D) Add ¶
func (c Coordinate3D) Add(to Coordinate3D) Coordinate3D
func (Coordinate3D) ApplyRotation ¶
func (c Coordinate3D) ApplyRotation(x, y, z int) Coordinate3D
func (Coordinate3D) Diff ¶
func (c Coordinate3D) Diff(to Coordinate3D) Coordinate3D
func (Coordinate3D) ManhattanDistance ¶
func (c Coordinate3D) ManhattanDistance(to Coordinate3D) int
func (Coordinate3D) String ¶
func (c Coordinate3D) String() string
func (Coordinate3D) Sub ¶
func (c Coordinate3D) Sub(to Coordinate3D) Coordinate3D
type CoordinateArray ¶
type CoordinateArray struct { Coordinates []Coordinate Y int X int }
func NewCoordinateArray ¶
func NewCoordinateArray(coords []Coordinate) CoordinateArray
func (CoordinateArray) Coordinate ¶
func (arr CoordinateArray) Coordinate(i int) Coordinate
func (CoordinateArray) Index ¶
func (arr CoordinateArray) Index(c Coordinate) int
func (CoordinateArray) Size ¶
func (arr CoordinateArray) Size() int
type CoordinateItem ¶
type CoordinateItem struct { Coordinate Coordinate Priority int Index int }
type Cuboid ¶
type Cuboid struct { From Coordinate3D To Coordinate3D }
func (Cuboid) Coordinates ¶
func (c Cuboid) Coordinates() []Coordinate3D
func (Cuboid) IsOverlapping ¶
func (Cuboid) Overlapping ¶
type IntMap ¶
func MapFromCoordinates ¶
func MapFromCoordinates(coordinates []Coordinate) IntMap
func (IntMap) Adjacent ¶
func (m IntMap) Adjacent(c Coordinate) []Coordinate
func (IntMap) ArrPos ¶
func (m IntMap) ArrPos(c Coordinate) int
func (IntMap) At ¶
func (m IntMap) At(c Coordinate) int
func (IntMap) Coordinates ¶
func (m IntMap) Coordinates() []Coordinate
func (IntMap) Exists ¶
func (m IntMap) Exists(c Coordinate) bool
func (*IntMap) Inc ¶
func (m *IntMap) Inc(c Coordinate)
func (*IntMap) Set ¶
func (m *IntMap) Set(c Coordinate, val int)
func (IntMap) Surrounding ¶
func (m IntMap) Surrounding(c Coordinate) []Coordinate
func (IntMap) WithPadding ¶
type PriorityQueue ¶
type PriorityQueue []*CoordinateItem
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
func (*PriorityQueue) Update ¶
func (pq *PriorityQueue) Update(item *CoordinateItem, value Coordinate, priority int)
type Rotation3D ¶
type Rotation3D interface {
Apply(c Coordinate3D) Coordinate3D
}
type RotationDirection ¶
func (RotationDirection) Apply ¶
func (r RotationDirection) Apply(c Coordinate3D) Coordinate3D
type RotationFacing ¶
type RotationFacing struct { X string Y string Z string Direction RotationDirection }
func (RotationFacing) Apply ¶
func (r RotationFacing) Apply(c Coordinate3D) Coordinate3D
Click to show internal directories.
Click to hide internal directories.