implemented getWinner method

This commit is contained in:
Leonardo Brandenberger 2022-03-18 09:58:13 +01:00
parent b606f20d9f
commit 06ad28fbe8
1 changed files with 6 additions and 1 deletions

View File

@ -121,7 +121,12 @@ public class Game implements GameSpecification {
*/ */
@Override @Override
public int getWinner() { public int getWinner() {
// TODO: implementation List<Car> cars = track.getCars();
for (Car car: cars) {
if(car.getWinPoints() == 1){
return car.getID();
}
}
return NO_WINNER; return NO_WINNER;
} }