When DNFing the car/player should get 0 points
Right now it is possible to dnf as the last man standing and get all the points
The code checks DNF with just hitpoints like:
dnfRaces.setText(Long.toString(filteredResults.stream().filter(r -> r.remainingHitpoints <= 0).count()));
maybe
private int getPoints(boolean isDnf, int position) {
if (!isDnf) {
return position > pointDistribution.length ? 0 : pointDistribution[position - 1];
}
else {
return 0;
}
}
should check if player HP is above 0 and then return 0 points if player DNF'ed
Ive tried to add DNF by myself but there are lines like
final int total2 = positions.get(id2).stream().mapToInt(this::getPoints).sum();
and im not able to understand whats going on, I also dont have java experience
When DNFing the car/player should get 0 points
Right now it is possible to dnf as the last man standing and get all the points
The code checks DNF with just hitpoints like:
dnfRaces.setText(Long.toString(filteredResults.stream().filter(r -> r.remainingHitpoints <= 0).count()));
maybe
private int getPoints(boolean isDnf, int position) {
if (!isDnf) {
return position > pointDistribution.length ? 0 : pointDistribution[position - 1];
}
else {
return 0;
}
}
should check if player HP is above 0 and then return 0 points if player DNF'ed
Ive tried to add DNF by myself but there are lines like
final int total2 = positions.get(id2).stream().mapToInt(this::getPoints).sum();
and im not able to understand whats going on, I also dont have java experience