You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.6 KiB
70 lines
1.6 KiB
package seng302.Model;
|
|
|
|
import javafx.beans.property.DoubleProperty;
|
|
import javafx.beans.property.SimpleDoubleProperty;
|
|
import javafx.beans.property.SimpleStringProperty;
|
|
import javafx.beans.property.StringProperty;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
/**
|
|
* Created by fwy13 on 3/03/17.
|
|
*/
|
|
public class Boat {
|
|
private StringProperty name;
|
|
private double velocity;
|
|
private StringProperty velocityProp;
|
|
private String abbrev;
|
|
|
|
/**
|
|
* Boat initialiser which keeps all of the information of the boat.
|
|
* @param name Name of the Boat.
|
|
* @param velocity Speed in m/s that the boat travels at.
|
|
*/
|
|
public Boat(String name, double velocity, String abbrev){
|
|
this.velocity = velocity;
|
|
this.velocityProp = new SimpleStringProperty(String.valueOf(velocity* 1.94384));
|
|
this.abbrev = abbrev;
|
|
this.name = new SimpleStringProperty(name);
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return The name of the boat
|
|
*/
|
|
public StringProperty getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name.setValue(name);
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return returns the speed of the boat.
|
|
*/
|
|
public double getVelocity() {
|
|
return velocity;
|
|
}
|
|
|
|
public void setVelocity(double velocity) {
|
|
this.velocity = velocity;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return The Name of the boat.
|
|
*/
|
|
public String toString(){
|
|
return getName().toString();
|
|
}
|
|
|
|
public StringProperty getVelocityProp() {
|
|
return velocityProp;
|
|
}
|
|
|
|
public String getAbbrev() { return abbrev; }
|
|
|
|
}
|