Interface IClient

All Known Implementing Classes:
RMIClient, TCPClient

public interface IClient
Defines the operations that a client can request during the game.
  • Method Summary

    Modifier and Type
    Method
    Description
    connect(String username, int proposedNPlayers)
    Connects the client to the server using the specified username and preferred connection type.
    void
    drawLowerBuildingCard(String playerUsername, int pos)
    Requests to draw a building card from the lower building card list.
    void
    drawLowerTribeCard(String playerUsername, int pos)
    Requests to draw a tribe card from the lower tribe card list.
    void
    drawUpperBuildingCard(String playerUsername, int pos)
    Requests to draw a building card from the upper building card list.
    void
    drawUpperTribeCard(String playerUsername, int pos)
    Requests to draw a tribe card from the upper tribe card list.
    void
    Notifies the server of a voluntary disconnection and closes the connection.
    void
    skipTurn(String playerUsername)
    Requests to skip the current player's optional action.
    void
    slotChoice(String playerUsername, int pos)
    Requests to assign the specified player to a slot.
    void
    totemChoice(String playerUsername, String totem)
    Requests to assign the selected totem to the specified player.
  • Method Details

    • connect

      ErrorType connect(String username, int proposedNPlayers)
      Connects the client to the server using the specified username and preferred connection type.
      Parameters:
      username - the username chosen by the player.
      proposedNPlayers - the desired number of players proposed by this client.
      Returns:
      true if the connection is established successfully, false otherwise.
    • drawUpperTribeCard

      void drawUpperTribeCard(String playerUsername, int pos)
      Requests to draw a tribe card from the upper tribe card list.
      Parameters:
      playerUsername - the username of the player performing the action.
      pos - the position of the selected card in the upper tribe card list.
    • drawLowerTribeCard

      void drawLowerTribeCard(String playerUsername, int pos)
      Requests to draw a tribe card from the lower tribe card list.
      Parameters:
      playerUsername - the username of the player performing the action.
      pos - the position of the selected card in the lower tribe card list.
    • drawUpperBuildingCard

      void drawUpperBuildingCard(String playerUsername, int pos)
      Requests to draw a building card from the upper building card list.
      Parameters:
      playerUsername - the username of the player performing the action.
      pos - the position of the selected card in the upper building card list.
    • drawLowerBuildingCard

      void drawLowerBuildingCard(String playerUsername, int pos)
      Requests to draw a building card from the lower building card list.
      Parameters:
      playerUsername - the username of the player performing the action.
      pos - the position of the selected card in the lower building card list.
    • skipTurn

      void skipTurn(String playerUsername)
      Requests to skip the current player's optional action.
      Parameters:
      playerUsername - the username of the player skipping the action.
    • slotChoice

      void slotChoice(String playerUsername, int pos)
      Requests to assign the specified player to a slot.
      Parameters:
      playerUsername - the username of the player making the slot choice.
      pos - the position of the selected slot.
    • totemChoice

      void totemChoice(String playerUsername, String totem)
      Requests to assign the selected totem to the specified player.
      Parameters:
      playerUsername - the username of the player making the totem choice.
      totem - the name of the selected totem.
    • notifyDisconnection

      void notifyDisconnection()
      Notifies the server of a voluntary disconnection and closes the connection.