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 tovoid
askLobbyName()
Asks the user the name for the lobby to be createdvoid
askLobbySize()
Asks the user the number of players for its lobbyvoid
askToReloadLastSettings(java.util.List<java.lang.String> savedUsers)
Asks the user if it wants to reload a previously saved address/username combovoid
askUsername()
Asks the user the username it wants to usevoid
buildAction(java.util.List<Cell> gameBoard, java.util.List<Cell> buildableCells)
Asks the user to select a cell to build onvoid
chooseAction(java.util.List<PossibleActions> possibleActions)
Asks the user which action to performvoid
chooseBlockToBuild(java.util.List<Block> buildableBlocks)
Asks the user which block to build on a cellvoid
chooseGameGods(java.util.List<GodData> allGods, int size)
Asks the lobby owner to choose the gods for the gamevoid
chooseLobbyToJoin(java.util.Map<java.lang.String,java.util.List<java.lang.String>> lobbiesAvailable)
Asks the user which lobby it wants to joinvoid
chooseMatchReload()
Asks the user if it wants to reload an existing saved matchvoid
chooseStartingPlayer(java.util.List<java.lang.String> players)
Asks the user which player will play firstvoid
chooseUserGod(java.util.List<GodData> possibleGods)
Asks the user to pick its godvoid
chooseWorker(java.util.List<Cell> cells)
Asks the user to choose a workervoid
gameBoardUpdate(java.util.List<Cell> gameBoard, java.util.List<PlayerData> players)
Refreshes the game screenvoid
gameStartScreen(java.util.List<Cell> gameBoard, java.util.List<PlayerData> playerData)
Sets up the game board and its graphicsvoid
lobbyOptions(java.util.List<java.lang.String> options)
Asks the user if it wants to join or create a lobbyvoid
moveAction(java.util.List<Cell> gameBoard, java.util.List<Cell> walkableCells)
Asks the user to select a cell to move its current worker onvoid
placeWorker()
Asks the user to place its worker on the boardvoid
printLogo()
Prints the start screendefault void
printUserServerCombos(java.util.List<java.lang.String> options)
Shows the user the address/username combosvoid
setInputManager(InputManager inputManager)
Sets the InputManager to parse the inputsvoid
showErrorMessage(java.lang.String error)
Shows an error messagevoid
showGameBoard(java.util.List<Cell> gameBoard)
Prints the game board on the screenvoid
showSuccessMessage(java.lang.String message)
Shows a success message
-
Method Details
-
setInputManager
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
Asks the lobby owner to choose the gods for the game- Parameters:
allGods
- the list of available godssize
- the number of players
-
chooseUserGod
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
Sets up the game board and its graphics- Parameters:
gameBoard
- the starting game boardplayerData
- the players data
-
showGameBoard
Prints the game board on the screen- Parameters:
gameBoard
- the board to print
-
gameBoardUpdate
Refreshes the game screen- Parameters:
gameBoard
- the board to start withplayers
- information about the players
-
placeWorker
void placeWorker()Asks the user to place its worker on the board -
chooseWorker
Asks the user to choose a worker- Parameters:
cells
- the cells containing the player's workers
-
chooseAction
Asks the user which action to perform- Parameters:
possibleActions
- a list of possible actions
-
moveAction
Asks the user to select a cell to move its current worker on- Parameters:
gameBoard
- the current game boardwalkableCells
- the cells on which the worker can be moved to
-
buildAction
Asks the user to select a cell to build on- Parameters:
gameBoard
- the current game boardbuildableCells
- the cells on which the worker can build
-
chooseBlockToBuild
Asks the user which block to build on a cell- Parameters:
buildableBlocks
- the possible blocks (always more than one)
-