1
0
Fork 0
gilo/internal/gilo/point.go

24 lines
392 B
Go
Raw Permalink Normal View History

2021-04-13 14:54:44 -04:00
// Package gilo Point struct
2021-04-02 14:52:44 -04:00
package gilo
2021-05-20 11:45:15 -04:00
// Point an x,y coordinate
2021-04-02 14:52:44 -04:00
type Point struct {
X int
Y int
}
2021-05-20 11:45:15 -04:00
// DefaultPoint creates a Point at 0,0
2021-04-02 14:52:44 -04:00
func DefaultPoint() *Point {
return &Point{0, 0}
}
2021-05-20 11:45:15 -04:00
// NewPoint creates a new Point
2021-04-02 14:52:44 -04:00
func NewPoint(x, y int) *Point {
return &Point{x, y}
}
2021-04-06 16:37:58 -04:00
2021-05-20 11:45:15 -04:00
// Clone create a new point from an old one
2021-04-06 16:37:58 -04:00
func (p *Point) Clone() *Point {
return &Point{p.X, p.Y}
}