Tests for race clock being scaled correctly added
#story[16] #test
This commit is contained in:
@@ -20,7 +20,7 @@ public abstract class Race implements Runnable {
|
||||
protected int boatsFinished = 0;
|
||||
protected long totalTimeElapsed;
|
||||
|
||||
protected int scaleFactor = 1;
|
||||
protected int scaleFactor = 15;
|
||||
|
||||
private int SLEEP_TIME = 100; //time in milliseconds to pause in a paced loop
|
||||
protected int PRERACE_TIME = 10000;//Integer.MAX_VALUE; //time in milliseconds to pause during pre-race
|
||||
@@ -52,8 +52,12 @@ public abstract class Race implements Runnable {
|
||||
}
|
||||
|
||||
public Race(BoatInRace[] boats, ArrayList<Leg> legs, int scaleFactor) {
|
||||
for (BoatInRace boat : boats) {
|
||||
boat.setScaledVelocity(boat.getVelocity() * scaleFactor);
|
||||
if (boats.length > 0) {
|
||||
for (BoatInRace boat : boats) {
|
||||
if (boat != null) {
|
||||
boat.setScaledVelocity(boat.getVelocity() * scaleFactor);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.startingBoats = FXCollections.observableArrayList(boats);
|
||||
this.legs = legs;
|
||||
|
||||
Reference in New Issue
Block a user