mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Implemented wind walker algorithm. Refactored some GameState updating logic to allow for better token logic integration
GameState: Moved all token logic into its own function startPoint so that it is dsijoint from other updating logic GameState: Implemented wind walker algorithm. GameState: Changed Generic 'speedMultiplier' to 'serverSpeedMultiplier' to make it obviously disjoint from a boats speed multiplier MessageFactory: Moved some found message creation (Chatter Message) server side into MessageFactory that wasnt already there ServerYacht: Added a speed multiplier and a handling multiplier to the serveryacht class that is set and reset upon powerup / down #story[1293]
This commit is contained in:
@@ -56,6 +56,8 @@ public class ServerYacht {
|
||||
//PowerUp
|
||||
private TokenType powerUp;
|
||||
private Long powerUpStartTime;
|
||||
private Integer speedMultiplier;
|
||||
private Integer handlingMultiplier;
|
||||
|
||||
|
||||
public ServerYacht(BoatMeshType boatType, Integer sourceId, String hullID, String shortName,
|
||||
@@ -77,6 +79,8 @@ public class ServerYacht {
|
||||
this.legNumber = 0;
|
||||
this.boatColor = Colors.getColor(sourceId - 1);
|
||||
this.powerUp = null;
|
||||
this.speedMultiplier = 1;
|
||||
this.handlingMultiplier = 1;
|
||||
|
||||
this.hasEnteredRoundingZone = false;
|
||||
this.hasPassedLine = false;
|
||||
@@ -114,6 +118,8 @@ public class ServerYacht {
|
||||
|
||||
public void powerDown() {
|
||||
this.powerUp = null;
|
||||
this.speedMultiplier = 1;
|
||||
this.handlingMultiplier = 1;
|
||||
}
|
||||
|
||||
public Long getPowerUpStartTime() {
|
||||
@@ -130,7 +136,7 @@ public class ServerYacht {
|
||||
* @param amount the amount by which to adjust the boat heading.
|
||||
*/
|
||||
public void adjustHeading(Double amount) {
|
||||
Double newVal = heading + amount;
|
||||
Double newVal = heading + amount * handlingMultiplier;
|
||||
lastHeading = heading;
|
||||
heading = (double) Math.floorMod(newVal.longValue(), 360L);
|
||||
}
|
||||
@@ -429,4 +435,20 @@ public class ServerYacht {
|
||||
public BoatMeshType getBoatType() {
|
||||
return boatType;
|
||||
}
|
||||
|
||||
public Integer getSpeedMultiplier() {
|
||||
return speedMultiplier;
|
||||
}
|
||||
|
||||
public void setSpeedMultiplier(Integer speedMultiplier) {
|
||||
this.speedMultiplier = speedMultiplier;
|
||||
}
|
||||
|
||||
public Integer getHandlingMultiplier() {
|
||||
return handlingMultiplier;
|
||||
}
|
||||
|
||||
public void setHandlingMultiplier(Integer handlingMultiplier) {
|
||||
this.handlingMultiplier = handlingMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,4 @@ public class Token extends GeoPoint {
|
||||
tokenTypeList.remove(TokenType.RANDOM);
|
||||
tokenType = tokenTypeList.get(random.nextInt(tokenTypeList.size()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user