@ -12,6 +12,7 @@ import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.AnchorPane ;
import javafx.scene.paint.Color ;
import javafx.util.Callback ;
import org.geotools.referencing.GeodeticCalculator ;
import seng302.GPSCoordinate ;
import seng302.Model.ResizableRaceCanvas ;
import seng302.Model.* ;
@ -80,14 +81,25 @@ public class RaceController extends Controller{
canvasBase . getChildren ( ) . add ( raceMap ) ;
ArrayList < Leg > legs = new ArrayList < > ( ) ;
legs . add ( new Leg ( "Start" , 10 , new GPSCoordinate ( 32.296577 , - 64.854304 ) , new GPSCoordinate ( 32.296576 , - 64.854304 ) , 0 ) ) ;
legs . add ( new Leg ( "Mark" , 50 , new GPSCoordinate ( 32.296577 , - 64.854304 ) , new GPSCoordinate ( 32.308046 , - 64.831785 ) , 1 ) ) ;
ArrayList < Leg > legs = bermudaCourseLegs ( ) ;
ConstantVelocityRace race = new ConstantVelocityRace ( boats , legs , this ) ;
( new Thread ( race ) ) . start ( ) ;
}
private ArrayList < Leg > bermudaCourseLegs ( ) {
ArrayList < Leg > legs = new ArrayList < > ( ) ;
GeodeticCalculator calc = new GeodeticCalculator ( ) ;
calc . setStartingGeographicPoint ( 32.296577 , - 64.854304 ) ;
calc . setDestinationGeographicPoint ( 32.293039 , - 64.843983 ) ;
double distance = calc . getOrthodromicDistance ( ) ;
Leg leg1 = new Leg ( "Start to Mark 1" , distance , new GPSCoordinate ( 32.296577 , - 64.854304 ) ,
new GPSCoordinate ( 32.293039 , - 64.843983 ) , 0 ) ;
legs . add ( leg1 ) ;
return legs ;
}
}