package util; import util.Vec.Vec2; @:forward(x,y) abstract Pos(Vec2) from Vec2 to Vec2{ inline public function new(i:Vec2) { this = i; } @:op(A + B) public function add(rhs: Vec2):Pos { return new Pos({ y: this.y + rhs.y, x: this.x + rhs.x, }); } @:op(A - B) public function sub(rhs: Vec2):Pos { return new Pos({ y: this.y - rhs.y, x: this.x - rhs.x, }); } }