Package it.polimi.ingsw.view.gui
Class GUI
java.lang.Object
it.polimi.ingsw.view.gui.GUI
- All Implemented Interfaces:
ClientModelUpdaterInterface,LorenzoViewInterface,ViewInterface
public class GUI extends java.lang.Object implements ViewInterface, ClientModelUpdaterInterface
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidcardSlotUpdate(java.lang.String username, CardSlotUpdate stateUpdate)Updates the CardSlots of the player whose name is the one passed as parametervoidchestMergeUpdate(java.lang.String username)Merges the temporary chest of the player whose name is the one passed as parameter into his chestvoidchestUpdate(java.lang.String username, ChestUpdate stateUpdate)Updates the chest of the player whose name is the one passed as parametervoiddevDeckSetup(DevelopCardDeckSetup stateUpdate)Setups the DevelopCard DeckvoiddevDeckUpdate(DevelopCardDeckUpdate stateUpdate)Updates the DevelopCard DeckvoiddiscardedLeaderUpdate(java.lang.String username, LeaderUpdate stateUpdate)Updates not activated LeaderCards of the player whose name is the one passed as parameter discarding one of themvoiddisplayAlreadyProduced()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()voiddisplayFailedLogin()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 turnvoidgameStartedSetup(java.util.List<java.lang.String> stateUpdate)Setups players turn orderSceneControllergetSceneController()voidleaderSetup(java.lang.String username, LeaderSetup stateUpdate)Setups non activated LeaderCards of the player whose name is the one passed as parametervoidleaderUpdate(java.lang.String username, LeaderUpdate stateUpdate)Updates not activated LeaderCards of the player whose name is the one passed as parameter activating one of themvoidlorenzoDevDeckUpdate(DevelopCardDeckUpdate stateUpdate)Updates the DevelopCard Deck because Lorenzo has discarded a DevelopCard from the DeckvoidlorenzoShuffleUpdate()Updates Lorenzo because of having shuffledvoidlorenzoTrackUpdate(TrackUpdate stateUpdate)Updates Lorenzo's trackvoidmarketSetup(MarketSetup stateUpdate)Setups the marketvoidmarketUpdate(MarketUpdate stateUpdate)Updates the marketvoidsetClientTurnManager(ClientTurnManagerInterface turnManager)voidsetClientUsername(java.lang.String username)Sets the username of this client, which is passed as parametervoidstartingSetupUpdate()Starts the setup of the gamevoidtempChestUpdate(java.lang.String username, ChestUpdate stateUpdate)Updates the temporary chest of the player whose name is the one passed as parametervoidtrackUpdate(java.lang.String username, TrackUpdate stateUpdate)Updates the track of the player whose name is the one passed as parametervoidvaticanUpdate(java.lang.String username, VaticanReport stateUpdate)Updates the vatican cells of the player whose name is the one passed as parametervoidwarehouseUpdate(java.lang.String username, WarehouseUpdate stateUpdate)Updates the warehouse of the player whose name is the one passed as parameterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
GUI
-
-
Method Details
-
getSceneController
-
setClientTurnManager
- Specified by:
setClientTurnManagerin 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
-
displayInitialResourcesChoice
public void displayInitialResourcesChoice()Description copied from interface:ViewInterfaceDisplays the four marbles associated to a resource- Specified by:
displayInitialResourcesChoicein 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
-
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
-
displaySetupFailure
public void displaySetupFailure()Description copied from interface:ViewInterfaceDisplays that the server can not be reached- Specified by:
displaySetupFailurein interfaceViewInterface
-
displayDisconnected
public void displayDisconnected()- 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
-
displayPlayersNumberChoice
public void displayPlayersNumberChoice()Description copied from interface:ViewInterfaceDisplays the choice of the number of players- Specified by:
displayPlayersNumberChoicein 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
-
setClientUsername
public void setClientUsername(java.lang.String username)Description copied from interface:ClientModelUpdaterInterfaceSets the username of this client, which is passed as parameter- Specified by:
setClientUsernamein interfaceClientModelUpdaterInterface- Parameters:
username- , username of this client
-
chestUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates the chest of the player whose name is the one passed as parameter- Specified by:
chestUpdatein interfaceClientModelUpdaterInterface- Parameters:
username- , username of the player on which the update needs to take placestateUpdate- , update content
-
warehouseUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates the warehouse of the player whose name is the one passed as parameter- Specified by:
warehouseUpdatein interfaceClientModelUpdaterInterface- Parameters:
username- , username of the player on which the update needs to take placestateUpdate- , update content
-
leaderUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates not activated LeaderCards of the player whose name is the one passed as parameter activating one of them- Specified by:
leaderUpdatein interfaceClientModelUpdaterInterface- Parameters:
username- , username of the player on which the update needs to take placestateUpdate- , update content
-
leaderSetup
Description copied from interface:ClientModelUpdaterInterfaceSetups non activated LeaderCards of the player whose name is the one passed as parameter- Specified by:
leaderSetupin interfaceClientModelUpdaterInterface- Parameters:
username- , username of the player on which the setup needs to take placestateUpdate- , setup content
-
marketUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates the market- Specified by:
marketUpdatein interfaceClientModelUpdaterInterface- Parameters:
stateUpdate- , update content
-
marketSetup
Description copied from interface:ClientModelUpdaterInterfaceSetups the market- Specified by:
marketSetupin interfaceClientModelUpdaterInterface- Parameters:
stateUpdate- , setup content
-
cardSlotUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates the CardSlots of the player whose name is the one passed as parameter- Specified by:
cardSlotUpdatein interfaceClientModelUpdaterInterface- Parameters:
username- , username of the player on which the update needs to take placestateUpdate- , update content
-
trackUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates the track of the player whose name is the one passed as parameter- Specified by:
trackUpdatein interfaceClientModelUpdaterInterface- Parameters:
username- , username of the player on which the update needs to take placestateUpdate- , update content
-
vaticanUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates the vatican cells of the player whose name is the one passed as parameter- Specified by:
vaticanUpdatein interfaceClientModelUpdaterInterface- Parameters:
username- , username of the player on which the update needs to take placestateUpdate- , update content
-
devDeckUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates the DevelopCard Deck- Specified by:
devDeckUpdatein interfaceClientModelUpdaterInterface- Parameters:
stateUpdate- , update content
-
devDeckSetup
Description copied from interface:ClientModelUpdaterInterfaceSetups the DevelopCard Deck- Specified by:
devDeckSetupin interfaceClientModelUpdaterInterface- Parameters:
stateUpdate- , setup content
-
tempChestUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates the temporary chest of the player whose name is the one passed as parameter- Specified by:
tempChestUpdatein interfaceClientModelUpdaterInterface- Parameters:
username- , username of the player on which the update needs to take placestateUpdate- , update content
-
chestMergeUpdate
public void chestMergeUpdate(java.lang.String username)Description copied from interface:ClientModelUpdaterInterfaceMerges the temporary chest of the player whose name is the one passed as parameter into his chest- Specified by:
chestMergeUpdatein interfaceClientModelUpdaterInterface- Parameters:
username- , username of the player on which the update needs to take place
-
discardedLeaderUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates not activated LeaderCards of the player whose name is the one passed as parameter discarding one of them- Specified by:
discardedLeaderUpdatein interfaceClientModelUpdaterInterface- Parameters:
username- , username of the player on which the update needs to take placestateUpdate- , update content
-
lorenzoTrackUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates Lorenzo's track- Specified by:
lorenzoTrackUpdatein interfaceClientModelUpdaterInterface- Parameters:
stateUpdate- , update content
-
lorenzoShuffleUpdate
public void lorenzoShuffleUpdate()Description copied from interface:ClientModelUpdaterInterfaceUpdates Lorenzo because of having shuffled- Specified by:
lorenzoShuffleUpdatein interfaceClientModelUpdaterInterface
-
lorenzoDevDeckUpdate
Description copied from interface:ClientModelUpdaterInterfaceUpdates the DevelopCard Deck because Lorenzo has discarded a DevelopCard from the Deck- Specified by:
lorenzoDevDeckUpdatein interfaceClientModelUpdaterInterface- Parameters:
stateUpdate- , update content
-
gameStartedSetup
public void gameStartedSetup(java.util.List<java.lang.String> stateUpdate)Description copied from interface:ClientModelUpdaterInterfaceSetups players turn order- Specified by:
gameStartedSetupin interfaceClientModelUpdaterInterface- Parameters:
stateUpdate- , update content
-