30 lines
1015 B
Java
30 lines
1015 B
Java
package ch.zhaw.pm2.racetrack;
|
|
|
|
import java.io.FileNotFoundException;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
|
|
public static void main(String[] args) throws InvalidTrackFormatException, FileNotFoundException, PositionVectorNotValid {
|
|
boolean exit = false;
|
|
UserInterface userInterface = new UserInterface("Hello and Welcome");
|
|
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;
|
|
}
|
|
}
|
|
userInterface.printInformation("Thank you and goodbye");
|
|
}
|
|
|
|
}
|