From 82939e53ccc736b5389b5bab834a1f18a6ea3c31 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Wed, 13 Apr 2022 21:39:59 +0200 Subject: [PATCH] improved turtle kernel --- src/kernel/turtle/Turtle.hx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/kernel/turtle/Turtle.hx b/src/kernel/turtle/Turtle.hx index ae8d34a..340fbe0 100644 --- a/src/kernel/turtle/Turtle.hx +++ b/src/kernel/turtle/Turtle.hx @@ -6,11 +6,11 @@ using tink.CoreApi; class Turtle { public static var instance:Turtle; - public static var MAX_SLOTS(default, null):Int = 15; + public static final MAX_SLOTS:Int = 16; @:allow(kernel.Init) private function new() { - if (!Turtle.isTurtle()){ + if (!Turtle.isTurtle()) { Log.warn("Tried to initialize Turtle, but it is not available."); } } @@ -200,7 +200,8 @@ class Turtle { return cc.Turtle.compareTo(otherSlot + 1); } - public function transferToSlot(to:TurtleSlot, ?count:Int):Outcome { + public function transfer(from:TurtleSlot, to:TurtleSlot, ?count:Int):Outcome { + this.selectSlot(from); var r = cc.Turtle.transferTo(to + 1, count); return r ? Outcome.Success(null) : Outcome.Failure(null); }