diff --git a/src/lib/turtle/TurtleExecuter.hx b/src/lib/turtle/TurtleExecuter.hx index 39271c3..0da5936 100644 --- a/src/lib/turtle/TurtleExecuter.hx +++ b/src/lib/turtle/TurtleExecuter.hx @@ -1,5 +1,6 @@ package lib.turtle; +import util.Pos; import util.Pos3; import kernel.turtle.Turtle; using tink.CoreApi; @@ -36,7 +37,11 @@ class TurtleExecuter { return blocks; } - public function getFinalOffset(): Pos3 { + /** + Return the offset of the turtle after executing the instructions. + The origin is the starting position of the turtle. + **/ + public function getFinalOffset(): {offset: Pos3, faceing: Pos} { var pos: Pos3 = {x:0, y:0, z:0}; var forwardVec: Pos3 = {x: 1, y: 0, z: 0}; @@ -54,7 +59,7 @@ class TurtleExecuter { } } - return pos; + return {offset:pos,faceing: new Pos({x:forwardVec.x, y:forwardVec.z})}; } public function execute() {