public interface ViewInterface
Common methods for the UI
-
Method Summary
Modifier and Type Method Description voidaskIP()Asks the user the server address to connect tovoidaskLobbyName()Asks the user the name for the lobby to be createdvoidaskLobbySize()Asks the user the number of players for its lobbyvoidaskToReloadLastSettings(java.util.List<java.lang.String> savedUsers)Asks the user if it wants to reload a previously saved address/username combovoidaskUsername()Asks the user the username it wants to usevoidbuildAction(java.util.List<Cell> gameBoard, java.util.List<Cell> buildableCells)Asks the user to select a cell to build onvoidchooseAction(java.util.List<PossibleActions> possibleActions)Asks the user which action to performvoidchooseBlockToBuild(java.util.List<Block> buildableBlocks)Asks the user which block to build on a cellvoidchooseGameGods(java.util.List<GodData> allGods, int size)Asks the lobby owner to choose the gods for the gamevoidchooseLobbyToJoin(java.util.Map<java.lang.String,java.util.List<java.lang.String>> lobbiesAvailable)Asks the user which lobby it wants to joinvoidchooseMatchReload()Asks the user if it wants to reload an existing saved matchvoidchooseStartingPlayer(java.util.List<java.lang.String> players)Asks the user which player will play firstvoidchooseUserGod(java.util.List<GodData> possibleGods)Asks the user to pick its godvoidchooseWorker(java.util.List<Cell> cells)Asks the user to choose a workervoidgameBoardUpdate(java.util.List<Cell> gameBoard, java.util.List<PlayerData> players)Refreshes the game screenvoidgameStartScreen(java.util.List<Cell> gameBoard, java.util.List<PlayerData> playerData)Sets up the game board and its graphicsvoidlobbyOptions(java.util.List<java.lang.String> options)Asks the user if it wants to join or create a lobbyvoidmoveAction(java.util.List<Cell> gameBoard, java.util.List<Cell> walkableCells)Asks the user to select a cell to move its current worker onvoidplaceWorker()Asks the user to place its worker on the boardvoidprintLogo()Prints the start screendefault voidprintUserServerCombos(java.util.List<java.lang.String> options)Shows the user the address/username combosvoidsetInputManager(InputManager inputManager)Sets the InputManager to parse the inputsvoidshowErrorMessage(java.lang.String error)Shows an error messagevoidshowGameBoard(java.util.List<Cell> gameBoard)Prints the game board on the screenvoidshowSuccessMessage(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)
-