18 lines
258 B
Go
18 lines
258 B
Go
|
package util
|
||
|
|
||
|
type Vec2 struct {
|
||
|
X, Y int64
|
||
|
}
|
||
|
|
||
|
func (v Vec2) Mult(by int64) Vec2 {
|
||
|
return Vec2{v.X * by, v.Y * by}
|
||
|
}
|
||
|
|
||
|
func (v Vec2) Add(a Vec2) Vec2 {
|
||
|
return Vec2{v.X + a.X, v.Y + a.Y}
|
||
|
}
|
||
|
|
||
|
func (v Vec2) Eq(a Vec2) bool {
|
||
|
return v.X == a.X && v.Y == a.Y
|
||
|
}
|