Package it.polimi.ingsw.network.client
Class NetworkVirtualModel
java.lang.Object
it.polimi.ingsw.network.client.NetworkVirtualModel
- All Implemented Interfaces:
VirtualModel
public class NetworkVirtualModel extends java.lang.Object implements VirtualModel
Class instantiated once a game is played in network configuration.
This class connects the Client class with the ServerConnector one
-
Constructor Summary
Constructors Constructor Description NetworkVirtualModel(ServerConnector serverConnector)Constructor for NetworkVirtualModel class -
Method Summary
Modifier and Type Method Description voidhandleAction(Action action)Forward action to servevoidhandleMessage(Message message)Forward message to servervoidstop()Stops action and message forwardingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
NetworkVirtualModel
Constructor for NetworkVirtualModel class- Parameters:
serverConnector- , instance of ServerConnector used to send messages to server
-
-
Method Details
-
handleAction
Description copied from interface:VirtualModelForward action to serve- Specified by:
handleActionin interfaceVirtualModel- Parameters:
action- , action to forward
-
handleMessage
Description copied from interface:VirtualModelForward message to server- Specified by:
handleMessagein interfaceVirtualModel- Parameters:
message- , message to forward
-
stop
public void stop()Description copied from interface:VirtualModelStops action and message forwarding- Specified by:
stopin interfaceVirtualModel
-