Merge remote-tracking branch 'origin/main'
This commit is contained in:
		
						commit
						c72ae904e7
					
				| 
						 | 
				
			
			@ -115,7 +115,7 @@ public class Track implements TrackSpecification {
 | 
			
		|||
                char possibleCarChar = line.charAt(xPosition);
 | 
			
		||||
                if (!allSpaceTypesAsChar.contains(possibleCarChar)) {
 | 
			
		||||
                    if (usedSymbolForCar.contains(possibleCarChar)) {
 | 
			
		||||
                        throw new InvalidTrackFormatException();
 | 
			
		||||
                        throw new InvalidTrackFormatException("More than one car on track!");
 | 
			
		||||
                    }
 | 
			
		||||
                    usedSymbolForCar.add(possibleCarChar);
 | 
			
		||||
                    cars.add(new Car(possibleCarChar, new PositionVector(xPosition, yPosition)));
 | 
			
		||||
| 
						 | 
				
			
			@ -143,12 +143,12 @@ public class Track implements TrackSpecification {
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (finishLine.size() == 0) {
 | 
			
		||||
            throw new InvalidTrackFormatException();
 | 
			
		||||
            throw new InvalidTrackFormatException("No finish line found!");
 | 
			
		||||
        }
 | 
			
		||||
        finishTyp = getSpaceType(finishLine.get(0));
 | 
			
		||||
        for (PositionVector positionVector : finishLine) {
 | 
			
		||||
            if (getSpaceType(positionVector) != finishTyp) {
 | 
			
		||||
                throw new InvalidTrackFormatException();
 | 
			
		||||
                throw new InvalidTrackFormatException("Inconsistent finish line found!");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue