mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user