team02-AngryNerds-projekt1-.../src/main/java/ch/zhaw/pm2/racetrack/Main.java

30 lines
1015 B
Java
Raw Normal View History

package ch.zhaw.pm2.racetrack;
import java.io.FileNotFoundException;
2022-03-18 13:34:51 +01:00
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) throws InvalidTrackFormatException, FileNotFoundException, PositionVectorNotValid {
2022-03-18 13:34:51 +01:00
boolean exit = false;
2022-03-18 16:13:37 +01:00
UserInterface userInterface = new UserInterface("Hello and Welcome");
2022-03-18 13:34:51 +01:00
while (!exit) {
Game game = new Game(userInterface);
int winner = 0;
if (game.initPhase()) {
winner = game.gamePhase();
}
List<String> optionsNewGame = new ArrayList<>();
optionsNewGame.add("exit");
optionsNewGame.add("new game");
int selectedOption = userInterface.selectOption("The Winner was Car : " + winner + "\nStart new Game?", optionsNewGame);
if(selectedOption == 0) {
exit = true;
}
}
2022-03-18 16:13:37 +01:00
userInterface.printInformation("Thank you and goodbye");
}
}