generated from hummel/Bank-System
UI verbessert
parent
12e1932f45
commit
495a5a7ac8
|
@ -0,0 +1,14 @@
|
|||
import tpe.facade.FactorySystem;
|
||||
import tpe.ui.UI;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
FactorySystem fs = new FactorySystem("Roboterfabrik");
|
||||
UI ui = new UI(fs);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -3,6 +3,7 @@ package tpe.ui;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Scanner;
|
||||
|
||||
import tpe.exceptions.RobotException;
|
||||
import tpe.exceptions.roboter.RobotFactory;
|
||||
import tpe.facade.FactorySystem;
|
||||
|
||||
|
@ -116,7 +117,10 @@ private void menu() {
|
|||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt den Status des Roboters an
|
||||
* @param id
|
||||
*/
|
||||
private void robotStatus(int id) {
|
||||
boolean status = fs.powerStatus(id);
|
||||
if (status == true)
|
||||
|
@ -131,6 +135,8 @@ private void menu() {
|
|||
System.out.println("Der Roboter wurde eingeschaltet.");
|
||||
else
|
||||
System.out.println("Der Roboter wurde ausgeschaltet.");
|
||||
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
private void robotSpeak(int id) {
|
||||
|
@ -163,9 +169,12 @@ private void menu() {
|
|||
int [] numbers = arrayNumbers.stream().mapToInt(j -> j).toArray();
|
||||
|
||||
String output;
|
||||
// try {
|
||||
// output = fs. hier muss noch eine Verknüpfung zur sprechmethode in Factory System rein
|
||||
// }
|
||||
try {
|
||||
output = fs.robotInstructions(id, numbers);
|
||||
System.out.println("Der Roboter gibt folgendes aus: " + output);
|
||||
} catch (RobotException e) {
|
||||
System.out.println("Fehler!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue