merge Game.java
This commit is contained in:
		
							parent
							
								
									f133f4305d
								
							
						
					
					
						commit
						82911fcfb6
					
				| 
						 | 
				
			
			@ -1,7 +1,6 @@
 | 
			
		|||
package ch.zhaw.pm2.racetrack.strategy;
 | 
			
		||||
 | 
			
		||||
import ch.zhaw.pm2.racetrack.PositionVector;
 | 
			
		||||
import ch.zhaw.pm2.racetrack.PositionVectorNotValid;
 | 
			
		||||
import ch.zhaw.pm2.racetrack.Track;
 | 
			
		||||
 | 
			
		||||
import java.util.*;
 | 
			
		||||
| 
						 | 
				
			
			@ -93,14 +92,11 @@ public class PathFinderMoveStrategy implements MoveStrategy{
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
        public boolean crashed() {
 | 
			
		||||
            try {
 | 
			
		||||
                for(PositionVector point : track.calculatePointsOnPath(positions.get(positions.size()-1), positions.get(positions.size()-2)))
 | 
			
		||||
                if(track.willCrashAtPosition(carIndex, point)){
 | 
			
		||||
                    return true;
 | 
			
		||||
                for(PositionVector point : track.calculatePointsOnPath(positions.get(positions.size()-1), positions.get(positions.size()-2))) {
 | 
			
		||||
                    if (track.willCrashAtPosition(carIndex, point)) {
 | 
			
		||||
                        return true;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            } catch (PositionVectorNotValid e) {
 | 
			
		||||
                return true;
 | 
			
		||||
            }
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue