Game #23
|
@ -197,9 +197,12 @@ public class Game implements GameSpecification {
|
||||||
@Override
|
@Override
|
||||||
public void switchToNextActiveCar() {
|
public void switchToNextActiveCar() {
|
||||||
do {
|
do {
|
||||||
if (currentCarIndex++ > track.getCarCount()) {
|
if ((currentCarIndex + 1) == track.getCarCount()) {
|
||||||
currentCarIndex = 0;
|
currentCarIndex = 0;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
currentCarIndex ++;
|
||||||
|
}
|
||||||
} while (track.getCar(currentCarIndex).isCrashed());
|
} while (track.getCar(currentCarIndex).isCrashed());
|
||||||
// TODO: evtl andere Kapselung
|
// TODO: evtl andere Kapselung
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue