From 5c362245a43793bbb1c786f6d28df6d3d2952ee6 Mon Sep 17 00:00:00 2001 From: Haoming Yin Date: Tue, 7 Mar 2017 19:34:37 +1300 Subject: [PATCH] Added velocity related methods into Boat class. - added setVelocity() and getVelocity() #story[6] --- src/main/java/seng302/Boat.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/seng302/Boat.java b/src/main/java/seng302/Boat.java index 670aa04b..2205f025 100644 --- a/src/main/java/seng302/Boat.java +++ b/src/main/java/seng302/Boat.java @@ -9,6 +9,7 @@ public class Boat { // The name of the team, this is also the name of the boat private String teamName = null; + private float velocity = 0; public Boat(String teamName) { this.teamName = teamName; @@ -29,4 +30,20 @@ public class Boat 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 float getVelocity() { + return this.velocity; + } } \ No newline at end of file