java.lang.Object
java.util.Observable
view.data.GameModelReceiver
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGameModelReceiver(String ip, int port) The GameModelReceiver function is a constructor that creates a new socket connection to the server. -
Method Summary
Modifier and TypeMethodDescriptionThe getServer function returns the server socket.The getUpdatedModel function returns the updated model.voidsetUpdatedModel(GameManager newModel) The setUpdatedModel function is used to update the model of the game.Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Constructor Details
-
GameModelReceiver
The GameModelReceiver function is a constructor that creates a new socket connection to the server. It also starts listening for updates from the server in its own thread.- Parameters:
ip- ip Connect to the serverport- port Connect to the server
-
-
Method Details
-
setUpdatedModel
The setUpdatedModel function is used to update the model of the game.- Parameters:
newModel- newModel Update the model
-
getServer
The getServer function returns the server socket.- Returns:
- The server variable
-
getUpdatedModel
The getUpdatedModel function returns the updated model.- Returns:
- The updated model
-