Compare commits
2 Commits
3304d10da5
...
60b369fe27
| Author | SHA1 | Date | |
|---|---|---|---|
| 60b369fe27 | |||
| 1b9009d8e3 |
2
Makefile
2
Makefile
@@ -18,7 +18,7 @@ debug: HAXE_FLAGS += -D webconsole --debug
|
||||
debug: build
|
||||
|
||||
$(HAXE_PATH): $(shell find src -name '*.hx')
|
||||
haxe build.hxml $(HAXE_FLAGS)
|
||||
haxe build.hxml $(HAXE_FLAGS) --cmd "cp build/haxe.lua $(HAXE_PATH)"
|
||||
|
||||
$(MIN_PATH): $(POLYFILL_PATH)
|
||||
node minify.js $(POLYFILL_PATH) $@
|
||||
|
||||
26
src/util/Pos.hx
Normal file
26
src/util/Pos.hx
Normal file
@@ -0,0 +1,26 @@
|
||||
package util;
|
||||
|
||||
import util.Vec.Vec2;
|
||||
|
||||
@:forward(x,y)
|
||||
abstract Pos(Vec2<Int>) from Vec2<Int> to Vec2<Int>{
|
||||
inline public function new(i:Vec2<Int>) {
|
||||
this = i;
|
||||
}
|
||||
|
||||
@:op(A + B)
|
||||
public function add(rhs: Vec2<Int>):Pos {
|
||||
return new Pos({
|
||||
y: this.y + rhs.y,
|
||||
x: this.x + rhs.x,
|
||||
});
|
||||
}
|
||||
|
||||
@:op(A - B)
|
||||
public function sub(rhs: Vec2<Int>):Pos {
|
||||
return new Pos({
|
||||
y: this.y - rhs.y,
|
||||
x: this.x - rhs.x,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user