Pos2 multiply and negate
This commit is contained in:
parent
aca39ea46f
commit
e1bb9c3ac3
@ -27,4 +27,20 @@ abstract Pos(Vec2<Int>) from Vec2<Int> to Vec2<Int>{
|
||||
x: this.x - rhs.x,
|
||||
});
|
||||
}
|
||||
|
||||
@:op(A * B)
|
||||
public function multiply(rhs: Vec2<Int>): Pos {
|
||||
return new Pos({
|
||||
y: this.y * rhs.y,
|
||||
x: this.x * rhs.x,
|
||||
});
|
||||
}
|
||||
|
||||
@:op(-A)
|
||||
public function negate(): Pos {
|
||||
return new Pos({
|
||||
y: -this.y,
|
||||
x: -this.x,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user