mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Fixed incorrect headings and velocity display location
- Velocity is now shown in the list of starting boats #fix - Headings have been corrected Tags: #fix
This commit is contained in:
@@ -16,6 +16,7 @@ public class Event {
|
||||
private long time;
|
||||
private Boat boat;
|
||||
private Leg leg;
|
||||
private boolean isFinishingEvent = false;
|
||||
|
||||
public Event(long eventTime, Boat eventBoat, Leg eventLeg) {
|
||||
this.time = eventTime;
|
||||
@@ -23,6 +24,13 @@ public class Event {
|
||||
this.leg = eventLeg;
|
||||
}
|
||||
|
||||
public Event(long eventTime, Boat eventBoat, Leg eventLeg, boolean isFinishingEvent) {
|
||||
this.time = eventTime;
|
||||
this.boat = eventBoat;
|
||||
this.leg = eventLeg;
|
||||
this.isFinishingEvent = isFinishingEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the time for the event
|
||||
* @param eventTime the time for event in millisecond
|
||||
@@ -87,6 +95,14 @@ public class Event {
|
||||
this.leg.addBoatToMarker(boat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this event is the boat finishing the race
|
||||
*
|
||||
*/
|
||||
public boolean getIsFinishingEvent(){
|
||||
return this.isFinishingEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a string that contains the timestamp and course information for this event
|
||||
* @return A string that contains the timestamp and course information for this event
|
||||
@@ -94,6 +110,10 @@ public class Event {
|
||||
public String getEventString(){
|
||||
String currentHeading = Integer.toString(this.getLeg().getHeading());
|
||||
|
||||
if (this.isFinishingEvent){
|
||||
return (this.getTimeString() + ", " + this.getBoat().getTeamName() + " finished the race");
|
||||
}
|
||||
|
||||
return (this.getTimeString() + ", " + this.getBoat().getTeamName() + " passed " + this.getLeg().getMarkerLabel() + " going heading " + currentHeading + "°");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user