Class Client

java.lang.Object
it.polimi.ingsw.client.Client

public class Client
extends java.lang.Object
Client wants to play Santorini and tries to establish a connection to the server.
  • Constructor Summary

    Constructors 
    Constructor Description
    Client()  
  • Method Summary

    Modifier and Type Method Description
    void disconnect()
    Shows that the client is disconnecting from the server.
    static void main​(java.lang.String[] args)  
    void setUpConnection()
    Allows to set the connection to the game server.
    void setView()
    Allows the player to choose the type of view: CLI or GUI.
    java.lang.Object update​(Message receivedMessage)
    Updates and calls the specific method referring to the message received from the server.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • main

      public static void main​(java.lang.String[] args)
    • setUpConnection

      public void setUpConnection()
      Allows to set the connection to the game server. Starts the main threads to communicate with it, keeping also track of the heartbeat.
    • setView

      public void setView()
      Allows the player to choose the type of view: CLI or GUI.
    • update

      public java.lang.Object update​(Message receivedMessage)
      Updates and calls the specific method referring to the message received from the server.
      Parameters:
      receivedMessage - The message received from the server.
      Returns:
      The answer to send to the server.
    • disconnect

      public void disconnect()
      Shows that the client is disconnecting from the server.