Module AM37

Interface ViewInterface

All Known Implementing Classes:
CLI, GUI

public interface ViewInterface
Common methods for the UI
  • Method Summary

    Modifier and Type Method Description
    void askIP()
    Asks the user the server address to connect to
    void askLobbyName()
    Asks the user the name for the lobby to be created
    void askLobbySize()
    Asks the user the number of players for its lobby
    void askToReloadLastSettings​(java.util.List<java.lang.String> savedUsers)
    Asks the user if it wants to reload a previously saved address/username combo
    void askUsername()
    Asks the user the username it wants to use
    void buildAction​(java.util.List<Cell> gameBoard, java.util.List<Cell> buildableCells)
    Asks the user to select a cell to build on
    void chooseAction​(java.util.List<PossibleActions> possibleActions)
    Asks the user which action to perform
    void chooseBlockToBuild​(java.util.List<Block> buildableBlocks)
    Asks the user which block to build on a cell
    void chooseGameGods​(java.util.List<GodData> allGods, int size)
    Asks the lobby owner to choose the gods for the game
    void chooseLobbyToJoin​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> lobbiesAvailable)
    Asks the user which lobby it wants to join
    void chooseMatchReload()
    Asks the user if it wants to reload an existing saved match
    void chooseStartingPlayer​(java.util.List<java.lang.String> players)
    Asks the user which player will play first
    void chooseUserGod​(java.util.List<GodData> possibleGods)
    Asks the user to pick its god
    void chooseWorker​(java.util.List<Cell> cells)
    Asks the user to choose a worker
    void gameBoardUpdate​(java.util.List<Cell> gameBoard, java.util.List<PlayerData> players)
    Refreshes the game screen
    void gameStartScreen​(java.util.List<Cell> gameBoard, java.util.List<PlayerData> playerData)
    Sets up the game board and its graphics
    void lobbyOptions​(java.util.List<java.lang.String> options)
    Asks the user if it wants to join or create a lobby
    void moveAction​(java.util.List<Cell> gameBoard, java.util.List<Cell> walkableCells)
    Asks the user to select a cell to move its current worker on
    void placeWorker()
    Asks the user to place its worker on the board
    void printLogo()
    Prints the start screen
    default void printUserServerCombos​(java.util.List<java.lang.String> options)
    Shows the user the address/username combos
    void setInputManager​(InputManager inputManager)
    Sets the InputManager to parse the inputs
    void showErrorMessage​(java.lang.String error)
    Shows an error message
    void showGameBoard​(java.util.List<Cell> gameBoard)
    Prints the game board on the screen
    void showSuccessMessage​(java.lang.String message)
    Shows a success message
  • Method Details

    • setInputManager

      void setInputManager​(InputManager inputManager)
      Sets the InputManager to parse the inputs
      Parameters:
      inputManager - te inputManager to use
    • showErrorMessage

      void showErrorMessage​(java.lang.String error)
      Shows an error message
      Parameters:
      error - the error message
    • showSuccessMessage

      void showSuccessMessage​(java.lang.String message)
      Shows a success message
      Parameters:
      message - the message
    • printLogo

      void printLogo()
      Prints the start screen
    • askToReloadLastSettings

      void askToReloadLastSettings​(java.util.List<java.lang.String> savedUsers)
      Asks the user if it wants to reload a previously saved address/username combo
      Parameters:
      savedUsers - the address/username combos
    • printUserServerCombos

      default void printUserServerCombos​(java.util.List<java.lang.String> options)
      Shows the user the address/username combos
      Parameters:
      options - the address/username combos
    • askIP

      void askIP()
      Asks the user the server address to connect to
    • askUsername

      void askUsername()
      Asks the user the username it wants to use
    • lobbyOptions

      void lobbyOptions​(java.util.List<java.lang.String> options)
      Asks the user if it wants to join or create a lobby
      Parameters:
      options - the possible options
    • askLobbyName

      void askLobbyName()
      Asks the user the name for the lobby to be created
    • askLobbySize

      void askLobbySize()
      Asks the user the number of players for its lobby
    • chooseLobbyToJoin

      void chooseLobbyToJoin​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> lobbiesAvailable)
      Asks the user which lobby it wants to join
      Parameters:
      lobbiesAvailable - a map containing lobbies and their info
      See Also:
      Lobby.lobbyInfo()
    • chooseMatchReload

      void chooseMatchReload()
      Asks the user if it wants to reload an existing saved match
    • chooseGameGods

      void chooseGameGods​(java.util.List<GodData> allGods, int size)
      Asks the lobby owner to choose the gods for the game
      Parameters:
      allGods - the list of available gods
      size - the number of players
    • chooseUserGod

      void chooseUserGod​(java.util.List<GodData> possibleGods)
      Asks the user to pick its god
      Parameters:
      possibleGods - a list containing the available gods
    • chooseStartingPlayer

      void chooseStartingPlayer​(java.util.List<java.lang.String> players)
      Asks the user which player will play first
      Parameters:
      players - the list of players
    • gameStartScreen

      void gameStartScreen​(java.util.List<Cell> gameBoard, java.util.List<PlayerData> playerData)
      Sets up the game board and its graphics
      Parameters:
      gameBoard - the starting game board
      playerData - the players data
    • showGameBoard

      void showGameBoard​(java.util.List<Cell> gameBoard)
      Prints the game board on the screen
      Parameters:
      gameBoard - the board to print
    • gameBoardUpdate

      void gameBoardUpdate​(java.util.List<Cell> gameBoard, java.util.List<PlayerData> players)
      Refreshes the game screen
      Parameters:
      gameBoard - the board to start with
      players - information about the players
    • placeWorker

      void placeWorker()
      Asks the user to place its worker on the board
    • chooseWorker

      void chooseWorker​(java.util.List<Cell> cells)
      Asks the user to choose a worker
      Parameters:
      cells - the cells containing the player's workers
    • chooseAction

      void chooseAction​(java.util.List<PossibleActions> possibleActions)
      Asks the user which action to perform
      Parameters:
      possibleActions - a list of possible actions
    • moveAction

      void moveAction​(java.util.List<Cell> gameBoard, java.util.List<Cell> walkableCells)
      Asks the user to select a cell to move its current worker on
      Parameters:
      gameBoard - the current game board
      walkableCells - the cells on which the worker can be moved to
    • buildAction

      void buildAction​(java.util.List<Cell> gameBoard, java.util.List<Cell> buildableCells)
      Asks the user to select a cell to build on
      Parameters:
      gameBoard - the current game board
      buildableCells - the cells on which the worker can build
    • chooseBlockToBuild

      void chooseBlockToBuild​(java.util.List<Block> buildableBlocks)
      Asks the user which block to build on a cell
      Parameters:
      buildableBlocks - the possible blocks (always more than one)