tunnel command to turtle ctl
This commit is contained in:
parent
3e993b84eb
commit
b05dae958d
@ -1,5 +1,6 @@
|
||||
package bin;
|
||||
|
||||
import lib.turtle.Helper;
|
||||
import kernel.turtle.TurtleMutex;
|
||||
import kernel.turtle.Turtle;
|
||||
import lib.turtle.InvManager;
|
||||
@ -110,6 +111,11 @@ class TurtleCtl extends CLIAppBase {
|
||||
return Future.sync(false);
|
||||
}
|
||||
}, [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> {
|
||||
|
Loading…
Reference in New Issue
Block a user