change in gamephase in Game.java
This commit is contained in:
		
							parent
							
								
									3684b5589e
								
							
						
					
					
						commit
						1c618ad09a
					
				| 
						 | 
				
			
			@ -189,7 +189,12 @@ public class Game implements GameSpecification {
 | 
			
		|||
    public int gamePhase() throws PositionVectorNotValid {
 | 
			
		||||
        while (CarsMoving() && getWinner() == NO_WINNER) {
 | 
			
		||||
            userInterface.printTrack(track);
 | 
			
		||||
            Direction direction = track.getCar(currentCarIndex).getMoveStrategy().nextMove();
 | 
			
		||||
            Direction direction = null;
 | 
			
		||||
            direction= track.getCar(currentCarIndex).getMoveStrategy().nextMove();
 | 
			
		||||
            if(direction == null) {
 | 
			
		||||
                track.getCar(currentCarIndex).setMoveStrategy(new DoNotMoveStrategy());
 | 
			
		||||
                direction= track.getCar(currentCarIndex).getMoveStrategy().nextMove();
 | 
			
		||||
            }
 | 
			
		||||
            doCarTurn(direction);
 | 
			
		||||
            switchToNextActiveCar();
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue