Package it.polimi.ingsw.view.cli
Class Cli
java.lang.Object
it.polimi.ingsw.view.cli.Cli
- All Implemented Interfaces:
LorenzoViewInterface,ViewInterface
public class Cli extends java.lang.Object implements ViewInterface
CLI client class, manages the game if the player decides to play with Command Line Interface
-
Constructor Summary
Constructors Constructor Description Cli(ClientStateViewer stateViewer, CliDrawer drawer, Client client)Constructor for Cli class -
Method Summary
Modifier and Type Method Description voiddisplayAlreadyProduced()Displays that the production on a certain card can't be done because it as already been used in this turnvoiddisplayCannotDiscardActiveLeader()Displays that the deletion of the leader the player wanted to discard can't be done because it's activevoiddisplayCannotJoinMatch()Displays that the player cannot join the match they tried to: i.e. the match doesn't exist, the match is full or the match is already startedvoiddisplayChooseLeaderOnWhite()Displays the choice of the LeaderCard in case the marble to insert is whitevoiddisplayDefaultCanvas(java.lang.String username)Displays the default canvas of the player whose name is the one passed as parametervoiddisplayDisconnected()Method used to show disconnection from servervoiddisplayFailedLogin()Displays that the username is already takenvoiddisplayFatalError(java.lang.String errorMessage)Display a fatal error and ask the player to close the gamevoiddisplayFinalPhase()Enable the only actions that can be done in Final PhasevoiddisplayGameAlreadyStarted()Displays that the player can't join the game because it's already startedvoiddisplayGameEnded(java.lang.String payload)Displays that the game has endedvoiddisplayGameStarted()Displays that the game is startedvoiddisplayInitialResourcesChoice()Displays the four marbles associated to a resourcevoiddisplayInvalidCardPlacement()Displays that a card can't be placed in the slot the player wanted tovoiddisplayInvalidLeadercard()Displays that the player has inserted a LeaderCard that is not validvoiddisplayLeaderHand()Displays the LeaderCard of this client that have not been activated yetvoiddisplayLobbyCreated()Displays that the lobby has been successfully createdvoiddisplayLogin()Displays the login setup.voiddisplayLoginSuccessful(java.lang.String username)Displays that login setup has been operated correctlyvoiddisplayLorenzoDiscarded(DevelopCardDeckUpdate state)Displays that Lorenzo's last move hase been a discardvoiddisplayLorenzoMoved()Displays that Lorenzo has moved his faith markvoiddisplayLorenzoShuffled()Displays that Lorenzo's last move hase been a shufflevoiddisplayMarbleShopping()Displays the marbles player got from the market and let him insert onevoiddisplayMarket()voiddisplayMatchAlreadyExist()Displays that the name of the match the player tried to create is occupied by another matchvoiddisplayNetworkSetup()Display the network setup options.voiddisplayNotActivatableProduction()Displays that the production on a certain card can't be done because resources are not enoughvoiddisplayNotBuyable()Displays that the player can't buy the card he wanted because he hasn't enough resourcesvoiddisplayNotEnoughResources()Displays that the action can't be performed because resources are not enoughvoiddisplayOtherUserJoined(Message msg)Displays that another player joined the lobbyvoiddisplayPlainCanvas()Displays a plain canvasvoiddisplayPlayersNumberChoice()Displays the choice of the number of playersvoiddisplayPlayerTurn(java.lang.String player)Displays that it's the turn of the player whose name is the one passed as parametervoiddisplayProducingPhase()Enable the only actions that can be done in Production PhasevoiddisplayRecievedLeadercards()voiddisplayReconnection()voiddisplayServerDown()Displays that the server has crashedvoiddisplaySetupFailure()Displays that the server can not be reachedvoiddisplayShoppingPhase()voiddisplayWaiting()voiddisplayYouJoined()Displays that you have successfully joined the lobbyvoiddisplayYourTurn(java.lang.String username)Displays to the player whose name is the one passed as parameter that is it's turnvoidsetClientTurnManager(ClientTurnManagerInterface cliTurnManager)voidstartingSetupUpdate()Starts the setup of the gameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Cli
Constructor for Cli class- Parameters:
stateViewer- , instance of the interface that allows the user to query the client's side model statedrawer- , instance of the class that manage the Cli representation of the game stateclient- , client on which the Cli is running
-
-
Method Details
-
displayInitialResourcesChoice
public void displayInitialResourcesChoice()Description copied from interface:ViewInterfaceDisplays the four marbles associated to a resource- Specified by:
displayInitialResourcesChoicein interfaceViewInterface
-
displayMarbleShopping
public void displayMarbleShopping()Description copied from interface:ViewInterfaceDisplays the marbles player got from the market and let him insert one- Specified by:
displayMarbleShoppingin interfaceViewInterface
-
displayLeaderHand
public void displayLeaderHand()Description copied from interface:ViewInterfaceDisplays the LeaderCard of this client that have not been activated yet- Specified by:
displayLeaderHandin interfaceViewInterface
-
displayNetworkSetup
public void displayNetworkSetup()Description copied from interface:ViewInterfaceDisplay the network setup options. Asks for Ip address and port of the server- Specified by:
displayNetworkSetupin interfaceViewInterface
-
setClientTurnManager
- Specified by:
setClientTurnManagerin interfaceViewInterface
-
displayLogin
public void displayLogin()Description copied from interface:ViewInterfaceDisplays the login setup. Asks for username, if the player want to join or create a match and the room name- Specified by:
displayLoginin interfaceViewInterface
-
displayPlayersNumberChoice
public void displayPlayersNumberChoice()Description copied from interface:ViewInterfaceDisplays the choice of the number of players- Specified by:
displayPlayersNumberChoicein interfaceViewInterface
-
displaySetupFailure
public void displaySetupFailure()Description copied from interface:ViewInterfaceDisplays that the server can not be reached- Specified by:
displaySetupFailurein interfaceViewInterface
-
displayDisconnected
public void displayDisconnected()Method used to show disconnection from server- Specified by:
displayDisconnectedin interfaceViewInterface
-
displayFailedLogin
public void displayFailedLogin()Description copied from interface:ViewInterfaceDisplays that the username is already taken- Specified by:
displayFailedLoginin interfaceViewInterface
-
displayLoginSuccessful
public void displayLoginSuccessful(java.lang.String username)Description copied from interface:ViewInterfaceDisplays that login setup has been operated correctly- Specified by:
displayLoginSuccessfulin interfaceViewInterface- Parameters:
username- the player's username
-
displayLobbyCreated
public void displayLobbyCreated()Description copied from interface:ViewInterfaceDisplays that the lobby has been successfully created- Specified by:
displayLobbyCreatedin interfaceViewInterface
-
displayOtherUserJoined
Description copied from interface:ViewInterfaceDisplays that another player joined the lobby- Specified by:
displayOtherUserJoinedin interfaceViewInterface- Parameters:
msg- , message containing all the information to display
-
displayYouJoined
public void displayYouJoined()Description copied from interface:ViewInterfaceDisplays that you have successfully joined the lobby- Specified by:
displayYouJoinedin interfaceViewInterface
-
displayWaiting
public void displayWaiting()- Specified by:
displayWaitingin interfaceViewInterface
-
displayServerDown
public void displayServerDown()Description copied from interface:ViewInterfaceDisplays that the server has crashed- Specified by:
displayServerDownin interfaceViewInterface
-
displayGameAlreadyStarted
public void displayGameAlreadyStarted()Description copied from interface:ViewInterfaceDisplays that the player can't join the game because it's already started- Specified by:
displayGameAlreadyStartedin interfaceViewInterface
-
displayReconnection
public void displayReconnection()- Specified by:
displayReconnectionin interfaceViewInterface
-
displayGameStarted
public void displayGameStarted()Description copied from interface:ViewInterfaceDisplays that the game is started- Specified by:
displayGameStartedin interfaceViewInterface
-
displayRecievedLeadercards
public void displayRecievedLeadercards()- Specified by:
displayRecievedLeadercardsin interfaceViewInterface
-
displayMarket
public void displayMarket()- Specified by:
displayMarketin interfaceViewInterface
-
displayPlayerTurn
public void displayPlayerTurn(java.lang.String player)Description copied from interface:ViewInterfaceDisplays that it's the turn of the player whose name is the one passed as parameter- Specified by:
displayPlayerTurnin interfaceViewInterface- Parameters:
player- , player's username
-
displayYourTurn
public void displayYourTurn(java.lang.String username)Description copied from interface:ViewInterfaceDisplays to the player whose name is the one passed as parameter that is it's turn- Specified by:
displayYourTurnin interfaceViewInterface- Parameters:
username- , player's username
-
displayDefaultCanvas
public void displayDefaultCanvas(java.lang.String username)Description copied from interface:ViewInterfaceDisplays the default canvas of the player whose name is the one passed as parameter- Specified by:
displayDefaultCanvasin interfaceViewInterface- Parameters:
username- , username of the player
-
displayGameEnded
public void displayGameEnded(java.lang.String payload)Description copied from interface:LorenzoViewInterfaceDisplays that the game has ended- Specified by:
displayGameEndedin interfaceLorenzoViewInterface- Parameters:
payload- , contains the winner of the game and its score
-
displayPlainCanvas
public void displayPlainCanvas()Description copied from interface:ViewInterfaceDisplays a plain canvas- Specified by:
displayPlainCanvasin interfaceViewInterface
-
startingSetupUpdate
public void startingSetupUpdate()Description copied from interface:ViewInterfaceStarts the setup of the game- Specified by:
startingSetupUpdatein interfaceViewInterface
-
displayChooseLeaderOnWhite
public void displayChooseLeaderOnWhite()Description copied from interface:ViewInterfaceDisplays the choice of the LeaderCard in case the marble to insert is white- Specified by:
displayChooseLeaderOnWhitein interfaceViewInterface
-
displayFinalPhase
public void displayFinalPhase()Description copied from interface:ViewInterfaceEnable the only actions that can be done in Final Phase- Specified by:
displayFinalPhasein interfaceViewInterface
-
displayProducingPhase
public void displayProducingPhase()Description copied from interface:ViewInterfaceEnable the only actions that can be done in Production Phase- Specified by:
displayProducingPhasein interfaceViewInterface
-
displayShoppingPhase
public void displayShoppingPhase()- Specified by:
displayShoppingPhasein interfaceViewInterface
-
displayNotBuyable
public void displayNotBuyable()Description copied from interface:ViewInterfaceDisplays that the player can't buy the card he wanted because he hasn't enough resources- Specified by:
displayNotBuyablein interfaceViewInterface
-
displayInvalidLeadercard
public void displayInvalidLeadercard()Description copied from interface:ViewInterfaceDisplays that the player has inserted a LeaderCard that is not valid- Specified by:
displayInvalidLeadercardin interfaceViewInterface
-
displayCannotDiscardActiveLeader
public void displayCannotDiscardActiveLeader()Description copied from interface:ViewInterfaceDisplays that the deletion of the leader the player wanted to discard can't be done because it's active- Specified by:
displayCannotDiscardActiveLeaderin interfaceViewInterface
-
displayNotActivatableProduction
public void displayNotActivatableProduction()Description copied from interface:ViewInterfaceDisplays that the production on a certain card can't be done because resources are not enough- Specified by:
displayNotActivatableProductionin interfaceViewInterface
-
displayAlreadyProduced
public void displayAlreadyProduced()Description copied from interface:ViewInterfaceDisplays that the production on a certain card can't be done because it as already been used in this turn- Specified by:
displayAlreadyProducedin interfaceViewInterface
-
displayNotEnoughResources
public void displayNotEnoughResources()Description copied from interface:ViewInterfaceDisplays that the action can't be performed because resources are not enough- Specified by:
displayNotEnoughResourcesin interfaceViewInterface
-
displayInvalidCardPlacement
public void displayInvalidCardPlacement()Description copied from interface:ViewInterfaceDisplays that a card can't be placed in the slot the player wanted to- Specified by:
displayInvalidCardPlacementin interfaceViewInterface
-
displayMatchAlreadyExist
public void displayMatchAlreadyExist()Description copied from interface:ViewInterfaceDisplays that the name of the match the player tried to create is occupied by another match- Specified by:
displayMatchAlreadyExistin interfaceViewInterface
-
displayCannotJoinMatch
public void displayCannotJoinMatch()Description copied from interface:ViewInterfaceDisplays that the player cannot join the match they tried to: i.e. the match doesn't exist, the match is full or the match is already started- Specified by:
displayCannotJoinMatchin interfaceViewInterface
-
displayFatalError
public void displayFatalError(java.lang.String errorMessage)Description copied from interface:ViewInterfaceDisplay a fatal error and ask the player to close the game- Specified by:
displayFatalErrorin interfaceViewInterface- Parameters:
errorMessage- the error description
-
displayLorenzoDiscarded
Description copied from interface:LorenzoViewInterfaceDisplays that Lorenzo's last move hase been a discard- Specified by:
displayLorenzoDiscardedin interfaceLorenzoViewInterface- Parameters:
state- , update content
-
displayLorenzoMoved
public void displayLorenzoMoved()Description copied from interface:LorenzoViewInterfaceDisplays that Lorenzo has moved his faith mark- Specified by:
displayLorenzoMovedin interfaceLorenzoViewInterface
-
displayLorenzoShuffled
public void displayLorenzoShuffled()Description copied from interface:LorenzoViewInterfaceDisplays that Lorenzo's last move hase been a shuffle- Specified by:
displayLorenzoShuffledin interfaceLorenzoViewInterface
-