Merge branch 'master' into story_61
Also got client-server handshake working. Multiple clients can connect and control their own boat. The client's boat has a larger black triangle drawn around it. Probably needs tidying up. Added isClientBoat boolean to VisualiserBoat. WindGenerator is now an interface, implemented by ConstantWindGenerator (useful for testing) and RandomWindGenerator. Added ConstantWindGeneratorTest. RandomWindGenerator was formerly WindGenerator. The WindGenerator is passed in to MockRace. CommandFactory throws a CommandConstructionException if it cannot create a command. MessageSerialiser and MessageDeserialiser correctly terminate on error. Readded VisualiserInput's switch statement in the main loop, pending a refactor. Removed the sleep statement from LobbyController - it was blocking javaFX thread. Lobby.fxml: moved buttons and text input into grid panes, so they don't break when you resize screen. Added some test object creation functions in several test classes (MockRaceTest.createMockRace(), BoatXMLReaderTest.createBoatDataSource(), etc...). #story[1095]
This commit is contained in:
@@ -57,6 +57,11 @@ public class VisualiserBoat extends Boat {
|
||||
*/
|
||||
private static final double wakeScale = 5;
|
||||
|
||||
/**
|
||||
* If true then this boat has been allocated to the client.
|
||||
*/
|
||||
private boolean isClientBoat = false;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -214,4 +219,21 @@ public class VisualiserBoat extends Boat {
|
||||
return " -";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether or not this boat has been assigned to the client.
|
||||
* @return True if this is the client's boat.
|
||||
*/
|
||||
public boolean isClientBoat() {
|
||||
return isClientBoat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether or not this boat has been assigned to the client.
|
||||
* @param clientBoat True if this is the client's boat.
|
||||
*/
|
||||
public void setClientBoat(boolean clientBoat) {
|
||||
isClientBoat = clientBoat;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user