use BinStore in Terminal

This commit is contained in:
Djeeberjr 2023-05-23 14:36:51 +02:00
parent 94d02d60af
commit e73b4c4d14

View File

@ -1,5 +1,6 @@
package bin; package bin;
import kernel.binstore.BinStore;
import kernel.ps.ProcessHandle; import kernel.ps.ProcessHandle;
import kernel.ps.Process; import kernel.ps.Process;
import kernel.ps.ProcessManager; import kernel.ps.ProcessManager;
@ -146,22 +147,12 @@ class Terminal implements Process {
} }
private function getProgByName(name:String):Process { private function getProgByName(name:String):Process {
switch (name) { var bin = BinStore.instance.getBinByAlias(name);
case "hello": if (bin == null) {
return new HelloWorld();
case "net":
return new Net();
case "rs":
return new Redstone();
case "disk":
return new Disk();
case "gps":
return new GPS();
case "turtle":
return new Turtle();
default:
return null; return null;
} }
return Type.createInstance(bin.c,[]);
} }
private function moveCursorToInput() { private function moveCursorToInput() {