From e73b4c4d141602f5642d0b8cfbeaeec42b945a27 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Tue, 23 May 2023 14:36:51 +0200 Subject: [PATCH] use BinStore in Terminal --- src/bin/Terminal.hx | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/bin/Terminal.hx b/src/bin/Terminal.hx index 5915d1b..e802018 100644 --- a/src/bin/Terminal.hx +++ b/src/bin/Terminal.hx @@ -1,5 +1,6 @@ package bin; +import kernel.binstore.BinStore; import kernel.ps.ProcessHandle; import kernel.ps.Process; import kernel.ps.ProcessManager; @@ -146,22 +147,12 @@ class Terminal implements Process { } private function getProgByName(name:String):Process { - switch (name) { - case "hello": - 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; + var bin = BinStore.instance.getBinByAlias(name); + if (bin == null) { + return null; } + + return Type.createInstance(bin.c,[]); } private function moveCursorToInput() {