Cherry-picked CommandFactory connection between ControllerServer and RaceLogic.
#story[1096]
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
package visualiser.gameController;
|
||||
|
||||
import mock.model.commandFactory.Command;
|
||||
import mock.model.commandFactory.CommandFactory;
|
||||
import mock.model.RaceLogic;
|
||||
import network.BinaryMessageDecoder;
|
||||
import network.MessageDecoders.BoatActionDecoder;
|
||||
import network.Messages.Enums.BoatActionEnum;
|
||||
import visualiser.gameController.Keys.ControlKey;
|
||||
import visualiser.gameController.Keys.KeyFactory;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
@@ -29,13 +26,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