|
|
|
|
@ -27,6 +27,7 @@ import javafx.scene.shape.MeshView;
|
|
|
|
|
import javafx.scene.shape.Shape3D;
|
|
|
|
|
import javafx.scene.transform.Translate;
|
|
|
|
|
import javafx.util.Callback;
|
|
|
|
|
import network.Messages.Enums.BoatStatusEnum;
|
|
|
|
|
import network.Messages.Enums.RaceStatusEnum;
|
|
|
|
|
import shared.dataInput.RaceDataSource;
|
|
|
|
|
import shared.exceptions.BoatNotFoundException;
|
|
|
|
|
@ -68,8 +69,6 @@ public class RaceViewController extends Controller {
|
|
|
|
|
private ObservableList<Subject3D> viewSubjects;
|
|
|
|
|
private ResizableRaceCanvas raceCanvas;
|
|
|
|
|
private boolean mapToggle = true;
|
|
|
|
|
private int heartbeatDelay = 1000;
|
|
|
|
|
private long heartbeatTime = 0;
|
|
|
|
|
private GPSConverter gpsConverter;
|
|
|
|
|
private ArrayList<HealthEffect> healthEffectList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
@ -134,7 +133,6 @@ public class RaceViewController extends Controller {
|
|
|
|
|
isTutorial = true;
|
|
|
|
|
tutorialText.setVisible(true);
|
|
|
|
|
tutorialStates = new ArrayList<>(Arrays.asList(TutorialState.values()));
|
|
|
|
|
|
|
|
|
|
currentState = tutorialStates.get(0);
|
|
|
|
|
tutorialStates.remove(0);
|
|
|
|
|
searchMapForKey("Upwind");
|
|
|
|
|
@ -701,8 +699,15 @@ public class RaceViewController extends Controller {
|
|
|
|
|
|
|
|
|
|
if(fp.getSourceID()==boat.getSourceID()){
|
|
|
|
|
if(boat.getHealth()<=0){
|
|
|
|
|
fp.displayDeath();
|
|
|
|
|
fp.displayDeath(fp.getSourceID()==raceState.getPlayerBoatID());
|
|
|
|
|
fp.setSourceID(0);
|
|
|
|
|
try {
|
|
|
|
|
raceState.getBoat(boat.getSourceID()).setStatus(BoatStatusEnum.DNF);
|
|
|
|
|
|
|
|
|
|
raceState.updateBoatPositions(raceState.getBoats());
|
|
|
|
|
} catch (BoatNotFoundException e) {
|
|
|
|
|
System.out.println("Can't update boat");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if(boat.getHealth()<=10){
|
|
|
|
|
|