mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Implemented acceleration and full loading bars.
#story[1274]
This commit is contained in:
@@ -11,6 +11,7 @@ import seng302.utilities.GeoUtility;
|
||||
import seng302.visualiser.fxObjects.assets_3D.BoatMeshType;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Yacht class for the racing boat. <p> Class created to store more variables (eg. boat statuses)
|
||||
@@ -25,6 +26,7 @@ public class ServerYacht {
|
||||
private String boatType;
|
||||
private Double turnStep = 10.0;
|
||||
private Double maxSpeedMultiplier = 1.0;
|
||||
private Double acceleration = 1.0;
|
||||
private Integer sourceId;
|
||||
private String hullID; //matches HullNum in the XML spec.
|
||||
private String shortName;
|
||||
@@ -423,10 +425,11 @@ public class ServerYacht {
|
||||
public void setBoatType(String boatType) {
|
||||
BoatMeshType boatMeshType;
|
||||
for (BoatMeshType boatMesh: BoatMeshType.values()) {
|
||||
if (boatType == boatMesh.toString()) {
|
||||
if (Objects.equals(boatType, boatMesh.toString())) {
|
||||
boatMeshType = boatMesh;
|
||||
turnStep = boatMeshType.turnStep;
|
||||
maxSpeedMultiplier = boatMeshType.maxSpeedMultiplier;
|
||||
acceleration = boatMeshType.accelerationMultiplier;
|
||||
}
|
||||
}
|
||||
this.boatType = boatType;
|
||||
@@ -436,6 +439,10 @@ public class ServerYacht {
|
||||
return maxSpeedMultiplier;
|
||||
}
|
||||
|
||||
public Double getAcceleration(){
|
||||
return acceleration;
|
||||
}
|
||||
|
||||
public String getBoatType() {
|
||||
return boatType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user