From 98f688fa9d0bdc6886eafa3fdf43df81f9ba3133 Mon Sep 17 00:00:00 2001 From: nikow Date: Thu, 5 Jan 2023 16:37:57 +0100 Subject: [PATCH] Factory hat jetzt einen Switch womit der User arbeiten kann --- Roboterfabrik/src/ui/Factory.java | 47 +++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/Roboterfabrik/src/ui/Factory.java b/Roboterfabrik/src/ui/Factory.java index 698f385..c8955a8 100644 --- a/Roboterfabrik/src/ui/Factory.java +++ b/Roboterfabrik/src/ui/Factory.java @@ -1,7 +1,50 @@ package ui; +import java.util.Scanner; + public class Factory { + Scanner sc = new Scanner(System.in); + + public Factory() { + hauptmenü(); + } + + +private void hauptmenü() { + + mainloop: + while (true) { + System.out.println(); + System.out.println("========"); + System.out.println("Factory Hauptmenü"); + System.out.println("1 -> Roboter bauen"); + System.out.println("9 -> Beenden"); + System.out.println(); + + System.out.println("> "); + int input = Integer.parseInt(sc.nextLine()); + System.out.println(); + + try { + switch(input) { + case 1: roboterBauen(); + case 9: break mainloop; + } + + } catch (Exception e) { + + } + System.out.println(); + + + } - - } + + +private void roboterBauen() { + + +} + +} \ No newline at end of file