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
    void handleAction​(Action action)
    Forward action to serve
    void handleMessage​(Message message)
    Forward message to server
    void stop()
    Stops action and message forwarding

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NetworkVirtualModel

      public NetworkVirtualModel​(ServerConnector serverConnector)
      Constructor for NetworkVirtualModel class
      Parameters:
      serverConnector - , instance of ServerConnector used to send messages to server
  • Method Details

    • handleAction

      public void handleAction​(Action action)
      Description copied from interface: VirtualModel
      Forward action to serve
      Specified by:
      handleAction in interface VirtualModel
      Parameters:
      action - , action to forward
    • handleMessage

      public void handleMessage​(Message message)
      Description copied from interface: VirtualModel
      Forward message to server
      Specified by:
      handleMessage in interface VirtualModel
      Parameters:
      message - , message to forward
    • stop

      public void stop()
      Description copied from interface: VirtualModel
      Stops action and message forwarding
      Specified by:
      stop in interface VirtualModel