Documentation ¶
Index ¶
- type Point
- func (p Point) DiagonalNeighbours() []Point
- func (p Point) GetClosestPosition(candidates []Point) Point
- func (p Point) GetFarthestPosition(candidates []Point) Point
- func (p Point) ManhattanDistanceTo(point Point) int
- func (p Point) Neighbours() []Point
- func (p Point) PathLTo(point Point) []Point
- func (p Point) PositionsBresenhamTo(point Point) []Point
- func (p Point) Vector2(expX, expY int) rl.Vector2
- type Rect
- type Size
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Point ¶
type Point struct {
X, Y int
}
Point is a data structure for storing integer geom coordinates.
func (Point) DiagonalNeighbours ¶
DiagonalNeighbours generates all Point that share a corner with self. (NE,SE,SW,NW)
func (Point) GetClosestPosition ¶
GetClosestPosition of all the positions in candidates, return the one closest to self.
func (Point) GetFarthestPosition ¶
GetFarthestPosition of all the positions in candidates, return the one farthest from self.
func (Point) ManhattanDistanceTo ¶
ManhattanDistanceTo returns Manhattan distance between self and target Point.
func (Point) Neighbours ¶
Neighbours generates all Point that share a horizontal or vertical edge with this one. (N,S,E,W)
func (Point) PathLTo ¶
PathLTo generates all positions on an L-shaped path between self and target Point.
func (Point) PositionsBresenhamTo ¶
PositionsBresenhamTo generates all positions on a Bresenham algorithm line between self and other Point.