24 lines
392 B
Go
24 lines
392 B
Go
// Package gilo Point struct
|
|
package gilo
|
|
|
|
// Point an x,y coordinate
|
|
type Point struct {
|
|
X int
|
|
Y int
|
|
}
|
|
|
|
// DefaultPoint creates a Point at 0,0
|
|
func DefaultPoint() *Point {
|
|
return &Point{0, 0}
|
|
}
|
|
|
|
// NewPoint creates a new Point
|
|
func NewPoint(x, y int) *Point {
|
|
return &Point{x, y}
|
|
}
|
|
|
|
// Clone create a new point from an old one
|
|
func (p *Point) Clone() *Point {
|
|
return &Point{p.X, p.Y}
|
|
}
|