Package it.polimi.ingsw.network.client
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 voidhandleAction(Action action)Forward action to servevoidhandleMessage(Message message)Forward message to servervoidnotifyPhaseChanged(TurnState nextPhase)Notifies observers that the phase has changed into the one passed as parametervoidstop()Stops action and message forwardingMethods 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 actionsclientTurnManager- , instance of ClientTurnManagerclient- , client's instance
-
-
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
-
notifyPhaseChanged
Description copied from interface:PhaseChangedObservableNotifies observers that the phase has changed into the one passed as parameter- Specified by:
notifyPhaseChangedin interfacePhaseChangedObservable- Parameters:
nextPhase- , update content
-