Class LocalVirtualModel

java.lang.Object
it.polimi.ingsw.network.client.LocalVirtualModel
All Implemented Interfaces:
PhaseChangedObservable, VirtualModel

public class LocalVirtualModel
extends java.lang.Object
implements VirtualModel, PhaseChangedObservable
Class instantiated once a game is played in local configuration. This class connects the Client class with the TurnManager one
  • Constructor Summary

    Constructors
    Constructor Description
    LocalVirtualModel​(TurnManager turnManager, ClientTurnManagerInterface clientTurnManager, Client client)
    Constructor for LocalVirtualModel 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 notifyPhaseChanged​(TurnState nextPhase)
    Notifies observers that the phase has changed into the one passed as parameter
    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

    • LocalVirtualModel

      public LocalVirtualModel​(TurnManager turnManager, ClientTurnManagerInterface clientTurnManager, Client client)
      Constructor for LocalVirtualModel class
      Parameters:
      turnManager - , instance of TurnManager used to forward actions
      clientTurnManager - , instance of ClientTurnManager
      client - , client's instance
  • 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
    • notifyPhaseChanged

      public void notifyPhaseChanged​(TurnState nextPhase)
      Description copied from interface: PhaseChangedObservable
      Notifies observers that the phase has changed into the one passed as parameter
      Specified by:
      notifyPhaseChanged in interface PhaseChangedObservable
      Parameters:
      nextPhase - , update content