tunnel command to turtle ctl
This commit is contained in:
parent
3e993b84eb
commit
b05dae958d
@ -1,5 +1,6 @@
|
|||||||
package bin;
|
package bin;
|
||||||
|
|
||||||
|
import lib.turtle.Helper;
|
||||||
import kernel.turtle.TurtleMutex;
|
import kernel.turtle.TurtleMutex;
|
||||||
import kernel.turtle.Turtle;
|
import kernel.turtle.Turtle;
|
||||||
import lib.turtle.InvManager;
|
import lib.turtle.InvManager;
|
||||||
@ -110,6 +111,11 @@ class TurtleCtl extends CLIAppBase {
|
|||||||
return Future.sync(false);
|
return Future.sync(false);
|
||||||
}
|
}
|
||||||
}, [String("direction")]);
|
}, [String("direction")]);
|
||||||
|
|
||||||
|
registerAsyncSubcommand("tunnel", (args) -> {
|
||||||
|
var len = args.getInt("length");
|
||||||
|
return asynPerform(Helper.combine.bind([Turtle.dig.bind(Front), Turtle.forward, Turtle.dig.bind(Up)]), len);
|
||||||
|
}, [Int("length")]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function asynPerform(op:Void->Outcome<Noise, String>, times:Int):Future<Bool> {
|
private function asynPerform(op:Void->Outcome<Noise, String>, times:Int):Future<Bool> {
|
||||||
|
Loading…
Reference in New Issue
Block a user