mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Added velocity related methods into Boat class.
- added setVelocity() and getVelocity() #story[6]
This commit is contained in:
@@ -9,6 +9,7 @@ public class Boat
|
|||||||
{
|
{
|
||||||
// The name of the team, this is also the name of the boat
|
// The name of the team, this is also the name of the boat
|
||||||
private String teamName = null;
|
private String teamName = null;
|
||||||
|
private float velocity = 0;
|
||||||
|
|
||||||
public Boat(String teamName) {
|
public Boat(String teamName) {
|
||||||
this.teamName = teamName;
|
this.teamName = teamName;
|
||||||
@@ -29,4 +30,20 @@ public class Boat
|
|||||||
public void setTeamName(String teamName){
|
public void setTeamName(String teamName){
|
||||||
this.teamName = 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 float getVelocity() {
|
||||||
|
return this.velocity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user