Class GameboardController
java.lang.Object
it.polimi.ingsw.view.gui.controllers.GUIController
it.polimi.ingsw.view.gui.controllers.GameboardController
public class GameboardController extends GUIController
Java controller of the gameboard.fxml file
-
Field Summary
Fields inherited from class it.polimi.ingsw.view.gui.controllers.GUIController
client -
Constructor Summary
Constructors Constructor Description GameboardController() -
Method Summary
Modifier and Type Method Description voidaskLeaderOnWHite(java.lang.String username)Ask the player which leader card must be used to convert a white marblevoidconstructDeck(DevelopCardDeckSetup stateSetup)Construct the gui's develop card deckvoidconstructMarket(MarketSetup stateUpdate)Construct the GUI's marketvoiddisplayInitialResourcesChoice(java.lang.String username)Display the tmp marbles bought form marketvoiddisplayLeaderChoiceLable(java.lang.String username)Ask the player to discard two leader card during setupvoidenableFinalAction()Set disabled all the correct component for the final phasevoidenableInitialAction()Set disabled all the correct component for the initial phasevoidenableProductionAction()Set disabled all the correct component for the producing phasevoidenableShoppingAction()Set disabled all the correct component for the shopping phasePlayerboardControllergetPlayerBoardController(java.lang.String username)voidleaderSetup(java.lang.String username, LeaderSetup stateUpdate)Display leader cards during setupvoidotherPlayerTurn(java.lang.String username)Set disabled all the correct component during an other player turnvoidsetErrorLable(java.lang.String lableText)Display and errorvoidsetLorenzoToken(javafx.scene.image.Image image)Set the last lorenzo token imagevoidsetOtherPlayer(java.util.List<java.lang.String> players)Create the player boards of the other players loading the fxml files and saving their controllervoidsetTempMarbleVisible()voidsetupLorenzo()Set the last token and the black cross visiblevoidsetUsername(java.lang.String username)Set player username and create their personal player board loading the correct fxml file and saving its controllervoidupdateDeck(DevelopCardDeckUpdate stateUpdate)Display a deck update: a player bought a cardvoidupdateMarket(MarketUpdate stateUpdate)Display a market update when you are the player who bought from the market and show the tmp marble to insert them into warehousevoidupdateMarketOtherPlayers(MarketUpdate stateUpdate)Display a market update when another player bought a row or a columnMethods inherited from class it.polimi.ingsw.view.gui.controllers.GUIController
setClientMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
GameboardController
public GameboardController()
-
-
Method Details
-
constructDeck
Construct the gui's develop card deck- Parameters:
stateSetup- the state of the develop card deck
-
updateDeck
Display a deck update: a player bought a card- Parameters:
stateUpdate- the update object of the develop card deck
-
setUsername
public void setUsername(java.lang.String username)Set player username and create their personal player board loading the correct fxml file and saving its controller- Parameters:
username- player's username
-
setOtherPlayer
public void setOtherPlayer(java.util.List<java.lang.String> players)Create the player boards of the other players loading the fxml files and saving their controller- Parameters:
players- other player usernames list
-
setupLorenzo
public void setupLorenzo()Set the last token and the black cross visible -
setLorenzoToken
public void setLorenzoToken(javafx.scene.image.Image image)Set the last lorenzo token image- Parameters:
image- the image of the last token
-
getPlayerBoardController
- Parameters:
username- username of the user of which return the controller- Returns:
- the player board controller of the specified user
-
leaderSetup
Display leader cards during setup- Parameters:
username- username of the playerstateUpdate- the leader update containing the leader cards to display
-
constructMarket
Construct the GUI's market- Parameters:
stateUpdate- the model update representing the initial market
-
updateMarket
Display a market update when you are the player who bought from the market and show the tmp marble to insert them into warehouse- Parameters:
stateUpdate- the model update representing the market update
-
updateMarketOtherPlayers
Display a market update when another player bought a row or a column- Parameters:
stateUpdate- the model update representing the market update
-
askLeaderOnWHite
public void askLeaderOnWHite(java.lang.String username)Ask the player which leader card must be used to convert a white marble- Parameters:
username- username of this user
-
displayInitialResourcesChoice
public void displayInitialResourcesChoice(java.lang.String username)Display the tmp marbles bought form market- Parameters:
username- the player who bought from market
-
displayLeaderChoiceLable
public void displayLeaderChoiceLable(java.lang.String username)Ask the player to discard two leader card during setup- Parameters:
username- the player username
-
enableInitialAction
public void enableInitialAction()Set disabled all the correct component for the initial phase -
otherPlayerTurn
public void otherPlayerTurn(java.lang.String username)Set disabled all the correct component during an other player turn -
enableFinalAction
public void enableFinalAction()Set disabled all the correct component for the final phase -
enableProductionAction
public void enableProductionAction()Set disabled all the correct component for the producing phase -
enableShoppingAction
public void enableShoppingAction()Set disabled all the correct component for the shopping phase -
setErrorLable
public void setErrorLable(java.lang.String lableText)Display and error- Parameters:
lableText- error message
-
setTempMarbleVisible
public void setTempMarbleVisible()
-