java.lang.Object
polimi.ingsw.am21.codex.view.TUI.utils.Cli
- All Implemented Interfaces:
Remote,GameEventListener,RemoteGameEventListener,View
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcardPlaced(String gameId, String playerId, Integer playerHandCardNumber, Integer cardId, CardSideType side, Position position, int newPlayerScore, Map<ResourceType, Integer> updatedResources, Map<ObjectType, Integer> updatedObjects, Set<Position> availableSpots, Set<Position> forbiddenSpots) Interface method used to process the event of the current player placing a card on their playerboard.voidchangeTurn(String gameId, String playerNickname, Integer playerIndex, Boolean isLastRound, Set<Position> availableSpots, Set<Position> forbiddenSpots, Integer resourceDeckTopCardId, Integer goldDeckTopCardId) Interface method used to process the event of the player ending their turn choosing not to draw a card.voidvoidvoidvoidvoidDisplays the cards decks to draw fromvoiddrawChatMessage(ChatMessage message) voidvoiddrawGame()voidDon't use this in CLI, just draw the individual components when neededvoidvoiddrawHand()Displays the hand of the client playervoidvoidvoidvoidvoidDisplays the pairs the players can draw fromvoiddrawPlayerBoard(String nickname, int verticalOffset, int horizontalOffset) voidvoidvoidvoidgameHalted(String gameID) voidgameResumed(String gameID) voidvoidlobbyInfo(LobbyUsersInfo usersInfo) Interface method used to process the event of a player joining a game lobby when there are other players already inside it that may or may not have already completed the process of joining the game.voidplayerJoinedLobby(String gameId, UUID connectionID) Interface method used to process the event of a player joining a game lobby.voidplayerScoresUpdate(Map<String, Integer> newScores) Interface method used to process the event of the player's score being updated after the game ends and secret and common objectives are evaluated.voidpostNotification(Notification notification) voidpostNotification(NotificationType notificationType, String message) voidpostNotification(NotificationType notificationType, String[] parts, Colorable colorable, int colorableIndex) voidvoidprintUpdate(String string) voidsetClient(ClientConnectionHandler client) voiduserContext(FullUserGameContext context) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface polimi.ingsw.am21.codex.view.View
changeTurn, chatMessage, drawPlayerBoard, drawPlayerBoard, drawPlayerBoard, gameCreated, gameDeleted, gameOver, gameStarted, getObjectiveCards, getStarterCard, playerChoseObjectiveCard, playerConnectionChanged, playerJoinedGame, playerLeftLobby, playerSetNickname, playerSetToken, refreshLobbies, remainingRounds, winningPlayer
-
Constructor Details
-
Cli
public Cli()
-
-
Method Details
-
setClient
-
getLocalModel
- Specified by:
getLocalModelin interfaceView
-
postNotification
- Specified by:
postNotificationin interfaceView
-
postNotification
- Specified by:
postNotificationin interfaceView
-
postNotification
public void postNotification(NotificationType notificationType, String[] parts, Colorable colorable, int colorableIndex) - Specified by:
postNotificationin interfaceView
-
printPrompt
public void printPrompt() -
printUpdate
-
listGames
public void listGames() -
displayException
- Specified by:
displayExceptionin interfaceView
-
drawAvailableGames
public void drawAvailableGames()- Specified by:
drawAvailableGamesin interfaceView
-
drawAvailableTokenColors
public void drawAvailableTokenColors()- Specified by:
drawAvailableTokenColorsin interfaceView
-
drawLobby
public void drawLobby() -
drawGameBoard
public void drawGameBoard()Don't use this in CLI, just draw the individual components when needed- Specified by:
drawGameBoardin interfaceView
-
drawLeaderBoard
public void drawLeaderBoard()- Specified by:
drawLeaderBoardin interfaceView
-
drawPlayerBoards
public void drawPlayerBoards()- Specified by:
drawPlayerBoardsin interfaceView
-
drawPlayerBoard
- Specified by:
drawPlayerBoardin interfaceView
-
drawGame
public void drawGame() -
drawGameOver
public void drawGameOver()- Specified by:
drawGameOverin interfaceView
-
drawCard
-
drawHand
public void drawHand()Description copied from interface:ViewDisplays the hand of the client player -
drawPairs
public void drawPairs()Description copied from interface:ViewDisplays the pairs the players can draw from -
drawObjectiveCardChoice
public void drawObjectiveCardChoice()- Specified by:
drawObjectiveCardChoicein interfaceView
-
drawStarterCardSides
public void drawStarterCardSides()- Specified by:
drawStarterCardSidesin interfaceView
-
drawChatMessage
- Specified by:
drawChatMessagein interfaceView
-
drawCommonObjectiveCards
public void drawCommonObjectiveCards()- Specified by:
drawCommonObjectiveCardsin interfaceView
-
drawPlayerObjective
public void drawPlayerObjective()- Specified by:
drawPlayerObjectivein interfaceView
-
drawCardDecks
public void drawCardDecks()Description copied from interface:ViewDisplays the cards decks to draw from- Specified by:
drawCardDecksin interfaceView
-
lobbyInfo
Description copied from interface:RemoteGameEventListenerInterface method used to process the event of a player joining a game lobby when there are other players already inside it that may or may not have already completed the process of joining the game.- Specified by:
lobbyInfoin interfaceGameEventListener- Specified by:
lobbyInfoin interfaceRemoteGameEventListener- Specified by:
lobbyInfoin interfaceView- Parameters:
usersInfo- The information about the users in the lobby. It includes the nickname, token color, objective card choice, starter card side chosen, and in-game status of each user.
-
gameHalted
- Specified by:
gameHaltedin interfaceGameEventListener- Specified by:
gameHaltedin interfaceRemoteGameEventListener
-
gameResumed
- Specified by:
gameResumedin interfaceGameEventListener- Specified by:
gameResumedin interfaceRemoteGameEventListener
-
userContext
- Specified by:
userContextin interfaceGameEventListener- Specified by:
userContextin interfaceRemoteGameEventListener
-
drawNicknameChoice
public void drawNicknameChoice()- Specified by:
drawNicknameChoicein interfaceView
-
cardPlaced
public void cardPlaced(String gameId, String playerId, Integer playerHandCardNumber, Integer cardId, CardSideType side, Position position, int newPlayerScore, Map<ResourceType, Integer> updatedResources, Map<ObjectType, Integer> updatedObjects, Set<Position> availableSpots, Set<Position> forbiddenSpots) Description copied from interface:RemoteGameEventListenerInterface method used to process the event of the current player placing a card on their playerboard.- Specified by:
cardPlacedin interfaceGameEventListener- Specified by:
cardPlacedin interfaceRemoteGameEventListener- Specified by:
cardPlacedin interfaceView- Parameters:
gameId- The identifier of the game in which the card was placed.playerId- The identifier of the player that placed the card.playerHandCardNumber- The number of the card in the player's hand that was placed.cardId- The unique identifier of the card that was placed.side- The side of the card that was placed.position- The position on the player board where the card was placed.newPlayerScore- The updated score of the player that placed the card.updatedResources- The updated resources of the player that placed the card. The key is the type of resource and the value is the new amount of that resource.updatedObjects- The updated objects of the player that placed the card. The key is the type of object and the value is the new amount of that object.availableSpots- A set of positions that are available for the next player to place a card.forbiddenSpots- A set of positions that are forbidden for the next player to place a card. This set is used to display the forbidden spots on the gameboard.
-
playerScoresUpdate
Description copied from interface:RemoteGameEventListenerInterface method used to process the event of the player's score being updated after the game ends and secret and common objectives are evaluated.- Specified by:
playerScoresUpdatein interfaceGameEventListener- Specified by:
playerScoresUpdatein interfaceRemoteGameEventListener- Specified by:
playerScoresUpdatein interfaceView- Parameters:
newScores- A map containing the updated scores of the players. The key is the nickname of the player and the value is the new score of the player.
-
playerJoinedLobby
Description copied from interface:RemoteGameEventListenerInterface method used to process the event of a player joining a game lobby.- Specified by:
playerJoinedLobbyin interfaceGameEventListener- Specified by:
playerJoinedLobbyin interfaceRemoteGameEventListener- Specified by:
playerJoinedLobbyin interfaceView- Parameters:
gameId- The identifier of the game lobby that the player has joined.connectionID- The unique identifier of the player that has joined the lobby.
-
changeTurn
public void changeTurn(String gameId, String playerNickname, Integer playerIndex, Boolean isLastRound, Set<Position> availableSpots, Set<Position> forbiddenSpots, Integer resourceDeckTopCardId, Integer goldDeckTopCardId) Description copied from interface:RemoteGameEventListenerInterface method used to process the event of the player ending their turn choosing not to draw a card. This possibility is given by the fact that the decks might be empty, A player can choose not to draw in their last turn if they prefer not to draw from the pairs available on the gameboard- Specified by:
changeTurnin interfaceGameEventListener- Specified by:
changeTurnin interfaceRemoteGameEventListener- Specified by:
changeTurnin interfaceView- Parameters:
gameId- The unique identifier of the game that has just ended.playerNickname- The player that has just finished their turnplayerIndex- The index of the player that has just finished their turn in the list of players.isLastRound- A boolean indicating if this is the last round of the game.availableSpots- A set of positions that are available for the next player to place a card.forbiddenSpots- A set of positions that are forbidden for the next player to place a card.resourceDeckTopCardId- The unique identifier of the top card in the resource deck.goldDeckTopCardId- The unique identifier of the top card in the gold deck.
-