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.

42 lines
996 B

package visualiser.model;
/**
* The properties of the boat currently being controlled by the player. Singleton.
*/
public class ThisBoat {
private VisualiserBoat boat;
private static ThisBoat instance = new ThisBoat();
private ThisBoat(){}
public static ThisBoat getInstance(){
return instance;
}
public void setSailsOut(boolean sailsOut) {
if (this.boat != null) {
this.boat.setSailsOut(sailsOut);
}
}
public boolean isSailsOut() {
if (this.boat != null) {
return this.boat.isSailsOut();
} else {
return true;//TODO junk value to allow the client to spectate.
}
}
public int getSourceID() {
if (this.boat != null) {
return this.boat.getSourceID();
} else {
return 0;//TODO junk value to allow the client to spectate.
}
}
public void setBoat(VisualiserBoat boat) {
this.boat = boat;
}
}