Game #23
			
				
			
		
		
		
	| 
						 | 
				
			
			@ -187,6 +187,7 @@ public class Game implements GameSpecification {
 | 
			
		|||
            if(winner != NO_WINNER) {
 | 
			
		||||
                return winner;
 | 
			
		||||
            }
 | 
			
		||||
            switchToNextActiveCar();
 | 
			
		||||
        } while (!allCarsCrashed());
 | 
			
		||||
        return NO_WINNER;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,10 +7,11 @@ public class Main {
 | 
			
		|||
    public static void main(String[] args) throws InvalidTrackFormatException, FileNotFoundException, PositionVectorNotValid {
 | 
			
		||||
        UserInterface userInterface = new UserInterface("Hello and Welcome");
 | 
			
		||||
        Game game = new Game(userInterface);
 | 
			
		||||
 | 
			
		||||
        int winner = 0;
 | 
			
		||||
        if(game.initPhase()){
 | 
			
		||||
            int winner = game.gamePhase();
 | 
			
		||||
            winner = game.gamePhase();
 | 
			
		||||
        }
 | 
			
		||||
        userInterface.printInformation("Winner: " + winner);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,7 +52,7 @@ public class UserInterface {
 | 
			
		|||
     */
 | 
			
		||||
    public PositionVector.Direction selectDirection(int playingCarIndex, char playingCarID) {
 | 
			
		||||
        PositionVector.Direction direction = null;
 | 
			
		||||
        textTerminal.println("Playing Car " + playingCarIndex + ": " + playingCarIndex);
 | 
			
		||||
        textTerminal.println("Playing Car " + playingCarIndex + ": " + playingCarID);
 | 
			
		||||
        textTerminal.println("Directions are based on the number pad:");
 | 
			
		||||
        textTerminal.println("7 8 9    7=up-left,    8=up,               9=up-right");
 | 
			
		||||
        textTerminal.println("4 5 6    4=left,       5=no acceleration,  6=right");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue