mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Changed the team names to their abbreviated versions
- Also halved the size of the wake lines - Updated tests to support the shorter team names - Wake lines are now hidden with the other annotations Tags: #story[23,21]
This commit is contained in:
@@ -15,6 +15,7 @@ public class Boat {
|
||||
private Color color;
|
||||
private int markLastPast;
|
||||
private double heading;
|
||||
private String shortName;
|
||||
|
||||
public Boat(String teamName) {
|
||||
this.teamName = teamName;
|
||||
@@ -22,6 +23,7 @@ public class Boat {
|
||||
this.lat = 0.0;
|
||||
this.lon = 0.0;
|
||||
this.distanceToNextMark = 0.0;
|
||||
this.shortName = "";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,12 +31,14 @@ public class Boat {
|
||||
*
|
||||
* @param teamName The name of the team sailing the boat
|
||||
* @param boatVelocity The speed of the boat in meters/second
|
||||
* @param shortName A shorter version of the teams name
|
||||
*/
|
||||
public Boat(String teamName, double boatVelocity) {
|
||||
public Boat(String teamName, double boatVelocity, String shortName) {
|
||||
this.teamName = teamName;
|
||||
this.velocity = boatVelocity;
|
||||
this.distanceToNextMark = 0.0;
|
||||
this.color = Colors.getColor();
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,4 +123,8 @@ public class Boat {
|
||||
public double getHeading(){
|
||||
return this.heading;
|
||||
}
|
||||
|
||||
public String getShortName(){
|
||||
return this.shortName;
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class TeamsParser extends FileParser {
|
||||
String name = element.getElementsByTagName("name").item(0).getTextContent();
|
||||
String alias = element.getElementsByTagName("alias").item(0).getTextContent();
|
||||
double velocity = Double.valueOf(element.getElementsByTagName("velocity").item(0).getTextContent());
|
||||
Boat boat = new Boat(name, velocity);
|
||||
Boat boat = new Boat(name, velocity, alias);
|
||||
return boat;
|
||||
} else {
|
||||
throw new NoSuchElementException("Cannot generate a boat by given node");
|
||||
|
||||
Reference in New Issue
Block a user