Factory hat jetzt einen Switch womit der User arbeiten kann

master
nikow 2023-01-05 16:37:57 +01:00
parent 47375ba647
commit 98f688fa9d
1 changed files with 45 additions and 2 deletions

View File

@ -1,7 +1,50 @@
package ui; package ui;
public class Factory { 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() {
}
} }