Files
Party-Parrots-At-Sea/src/main/java/seng302/Boat.java
T
Michael Rausch ab1445f1c2 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
2017-03-08 12:31:31 +13:00

56 lines
1.1 KiB
Java

package seng302;
/**
* 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
{
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, double boatVelocity) {
this.teamName = teamName;
this.velocity = boatVelocity;
}
/**
* 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
*/
public void setTeamName(String teamName){
this.teamName = teamName;
}
/**
* Sets velocity of the boat
* @param velocity The velocity of boat
*/
public void setVelocity(float velocity) {
this.velocity = velocity;
}
/**
* Gets velocity of the boat
* @return a float number of the boat velocity
*/
public double getVelocity() {
return this.velocity;
}
}