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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user