Package view.data

Class GameModelReceiver

java.lang.Object
java.util.Observable
view.data.GameModelReceiver
All Implemented Interfaces:
Serializable

public class GameModelReceiver extends Observable implements Serializable
See Also:
  • Constructor Details

    • GameModelReceiver

      public GameModelReceiver(String ip, int port)
      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 server
      port - port Connect to the server
  • Method Details

    • setUpdatedModel

      public void setUpdatedModel(GameManager newModel)
      The setUpdatedModel function is used to update the model of the game.
      Parameters:
      newModel - newModel Update the model
    • getServer

      public MySocket getServer()
      The getServer function returns the server socket.
      Returns:
      The server variable
    • getUpdatedModel

      public GameManager getUpdatedModel()
      The getUpdatedModel function returns the updated model.
      Returns:
      The updated model