2022-12-08 14:58:44 +01:00
|
|
|
package ui;
|
|
|
|
|
2023-01-02 19:51:04 +01:00
|
|
|
import facade.Factory;
|
|
|
|
import infrastructure.Persistenz;
|
|
|
|
|
|
|
|
import java.util.Scanner;
|
|
|
|
|
2022-12-08 14:58:44 +01:00
|
|
|
public class UI {
|
2022-12-14 09:54:18 +01:00
|
|
|
|
2023-01-02 19:51:04 +01:00
|
|
|
private Factory factory;
|
|
|
|
private String name;
|
|
|
|
|
|
|
|
Scanner sc = new Scanner(System.in);
|
|
|
|
public UI (Factory factory){
|
|
|
|
this.factory = factory;
|
|
|
|
hauptmenü();
|
|
|
|
|
|
|
|
}
|
|
|
|
public UI (String name){
|
|
|
|
this.name = name;
|
|
|
|
if(Persistenz.existsSavedData(name)){
|
|
|
|
try{
|
|
|
|
this.factory = (Factory) Persistenz.loadFactoryData(name);
|
|
|
|
}catch(Exception e){
|
|
|
|
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
this.factory = new Factory();
|
|
|
|
}
|
|
|
|
}
|
2022-12-14 09:54:18 +01:00
|
|
|
|
2023-01-02 19:51:04 +01:00
|
|
|
public void hauptmenü(){
|
2022-12-14 09:54:18 +01:00
|
|
|
|
2023-01-02 19:51:04 +01:00
|
|
|
}
|
2022-12-08 14:58:44 +01:00
|
|
|
}
|