Class ClientCallbackImpl
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
it.polimi.ingsw.gc14.Network.RMI.Client.ClientCallbackImpl
- All Implemented Interfaces:
IClientCallback, Serializable, Remote
RMI client callback implementation of
IClientCallback.
Receives notifications from the server and updates the client game model.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientControllerThe client controller used to apply events and update the modelFields inherited from class RemoteObject
ref -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonAction(NetworkEvent event) Called by the server when an action has been accepted.voidonGameInit(MiniModel model) Called by the server when the game is initialized.Methods inherited from class UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObjectMethods inherited from class RemoteServer
getClientHost, getLog, setLog
-
Field Details
-
clientController
The client controller used to apply events and update the model
-
-
Constructor Details
-
ClientCallbackImpl
Class constructor.- Parameters:
clientController- the client controller- Throws:
RemoteException- if any RMI error occurs
-
-
Method Details
-
onGameInit
Called by the server when the game is initialized. Sets the client game model in theClientController.- Specified by:
onGameInitin interfaceIClientCallback- Parameters:
model- the initializedGamemodel- Throws:
RemoteException- if any RMI error occurs
-
onAction
Called by the server when an action has been accepted. If the event contains an error, it is printed to the console. Otherwise, the event is applied to the local model.- Specified by:
onActionin interfaceIClientCallback- Parameters:
event- theNetworkEventsent by the server- Throws:
RemoteException- if any RMI error occurs
-