@ -22,6 +22,7 @@ import seng302.Model.ResizableRaceCanvas;
import seng302.Model.* ;
import seng302.RaceMap ;
import java.awt.event.ActionEvent ;
import java.awt.geom.Point2D ;
import java.net.URL ;
import java.util.ArrayList ;
@ -86,10 +87,23 @@ public class RaceController extends Controller{
@FXML
public void startRace ( ) {
public void startRace1Min ( ) {
startRace ( 15 ) ;
}
BoatInRace [ ] boats = generateAC35Competitors ( ) ;
@FXML
public void startRace5Min ( ) {
startRace ( 3 ) ;
}
@FXML
public void startRaceNoScaling ( ) {
startRace ( 1 ) ;
}
private void startRace ( int scaleFactor ) {
BoatInRace [ ] boats = generateAC35Competitors ( ) ;
raceMap = new ResizableRaceCanvas ( ) ;
raceMap . widthProperty ( ) . bind ( canvasBase . widthProperty ( ) ) ;
raceMap . heightProperty ( ) . bind ( canvasBase . heightProperty ( ) ) ;
@ -100,7 +114,7 @@ public class RaceController extends Controller{
startScreen . setVisible ( false ) ;
ArrayList < Leg > legs = generateBermudaCourseLegs ( ) ;
ConstantVelocityRace race = new ConstantVelocityRace ( boats , legs , this );
ConstantVelocityRace race = new ConstantVelocityRace ( boats , legs , this , scaleFactor );
raceMap . setVisible ( true ) ;
( new Thread ( race ) ) . start ( ) ;
}