implemented getWinner method
This commit is contained in:
		
							parent
							
								
									b606f20d9f
								
							
						
					
					
						commit
						06ad28fbe8
					
				| 
						 | 
				
			
			@ -121,7 +121,12 @@ public class Game implements GameSpecification {
 | 
			
		|||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public int getWinner() {
 | 
			
		||||
        // TODO: implementation
 | 
			
		||||
        List<Car> cars = track.getCars();
 | 
			
		||||
        for (Car car: cars) {
 | 
			
		||||
            if(car.getWinPoints() == 1){
 | 
			
		||||
                return car.getID();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return NO_WINNER;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue