implemented getWinner method

This commit is contained in:
Leonardo Brandenberger committed 2022-03-18 09:58:13 +01:00
1 parent b606f20d9f
commit 06ad28fbe8
1 file changed
+6 -1
@@ -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;
}