VMGCommand now toggles autoVMG on and off. Linked up observer and observable so the current boat can now be controlled.

#Story[1097]
This commit is contained in:
zwu18
2017-08-06 14:48:46 +12:00
parent 554f8a2a0f
commit 074e2e590b
6 changed files with 38 additions and 2 deletions
@@ -1,5 +1,6 @@
package visualiser.gameController;
import mock.model.RaceLogic;
import mock.model.commandFactory.Command;
import mock.model.commandFactory.CommandFactory;
import network.BinaryMessageDecoder;
@@ -29,13 +30,19 @@ public class ControllerServer extends Observable implements Runnable {
* Last received boat action
*/
private BoatActionEnum action;
/**
*
*/
private RaceLogic rc;
/**
* Initialise server-side controller with live client socket
* @param socket to client
*/
public ControllerServer(Socket socket) {
public ControllerServer(Socket socket, RaceLogic rc) {
this.socket = socket;
this.rc = rc;
this.addObserver(rc);
try {
this.inputStream = new DataInputStream(this.socket.getInputStream());
} catch (IOException e) {