turtle init stuff

This commit is contained in:
Djeeberjr 2022-04-11 01:00:23 +02:00
parent 943391dddc
commit 8339c69ecc
3 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package kernel; package kernel;
import kernel.turtle.Turtle;
import haxe.MainLoop; import haxe.MainLoop;
import kernel.net.Routing; import kernel.net.Routing;
import cc.OS; import cc.OS;
@ -18,6 +19,10 @@ class Init {
MainTerm.instance = new MainTerm(); MainTerm.instance = new MainTerm();
Log.init(); Log.init();
if (Turtle.isTurtle()){
Turtle.instance = new Turtle();
}
Routing.instance = new Routing(); Routing.instance = new Routing();
Net.instance = new Net(); Net.instance = new Net();

View File

@ -4,9 +4,16 @@ import kernel.turtle.Types;
using tink.CoreApi; using tink.CoreApi;
typedef TurtleSlot = Int;
class Turtle { class Turtle {
public static var instance:Turtle;
@:allow(kernel.Init)
private function new() {
if (!Turtle.isTurtle()){
Log.warn("Tried to initialize Turtle, but it is not available.");
}
}
public static function isTurtle():Bool { public static function isTurtle():Bool {
return true; // TODO: Implement return true; // TODO: Implement
} }

View File

@ -22,3 +22,5 @@ typedef ItemInspect = {
public var damage:Int; public var damage:Int;
public var count:Int; public var count:Int;
} }
typedef TurtleSlot = Int;