Race events now display the boats heading and direction

- The boats velocity is being read from the config file
- The event text is now being printed when the leg starts #fix

Tags: #story[7] #implement
This commit is contained in:
Michael Rausch
2017-03-08 12:31:31 +13:00
parent 76faa53222
commit ab1445f1c2
8 changed files with 130 additions and 57 deletions
+18 -15
View File
@@ -1,35 +1,38 @@
package seng302;
/*
Represents a boat in the race.
@param teamName The name of the team sailing the boat
/**
* Represents a boat in the race.
*
* @param teamName The name of the team sailing the boat
* @param boatVelocity The speed of the boat in meters/second
*/
public class Boat
{
// The name of the team, this is also the name of the boat
private String teamName = null;
private float velocity = 70; // please set this one to a reasonable num!!!!!, i set it just for testing ;)
private String teamName; // The name of the team, this is also the name of the boat
private double velocity; // In meters/second
public Boat(String teamName) {
this.teamName = teamName;
this.velocity = 10; // Default velocity
}
public Boat(String teamName, float boatVelocity) {
public Boat(String teamName, double boatVelocity) {
this.teamName = teamName;
this.velocity = boatVelocity;
}
/*
Returns the name of the team sailing the boat
@returns The name of the team
/**
* Returns the name of the team sailing the boat
* @return The name of the team
*/
public String getTeamName(){
return this.teamName;
}
/*
Sets the name of the team sailing the boat
@param teamName The name of the team
/**
* Sets the name of the team sailing the boat
* @param teamName The name of the team
*/
public void setTeamName(String teamName){
this.teamName = teamName;
@@ -47,7 +50,7 @@ public class Boat
* Gets velocity of the boat
* @return a float number of the boat velocity
*/
public float getVelocity() {
public double getVelocity() {
return this.velocity;
}
}