Package it.polimi.ingsw.view
Class ClientModelState
java.lang.Object
it.polimi.ingsw.view.ClientModelState
- All Implemented Interfaces:
ClientModelUpdaterInterface,ClientStateViewer
public class ClientModelState extends java.lang.Object implements ClientModelUpdaterInterface, ClientStateViewer
Class that contains game state client side
-
Constructor Summary
Constructors Constructor Description ClientModelState()Constructor for ClientModelState class -
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 themvoidgameStartedSetup(java.util.List<java.lang.String> players)Setups players turn orderintgetPlayerTurnPosition()Returns the position that this client has in the turn listSimpleGameStategetSimpleGameState()Returns the SimpleGameStateSimplePlayerStategetSimplePlayerState()Returns this client's SimplePlayerStateSimplePlayerStategetSimplePlayerState(java.lang.String username)Returns the SimplePlayerState belonging to the specified playerjava.lang.StringgetUsername()Returns this client's usernamevoidleaderSetup(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 marketjava.util.List<java.lang.String>otherPlayersUsername()Returns the username list of the players in the game excluded this client's onevoidsetClientUsername(java.lang.String clientUsername)Sets the username of this client, which is passed as parametervoidtempChestUpdate(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 parameterjava.util.List<java.lang.String>usernameList()Returns the username list of the players in the gamevoidvaticanUpdate(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
-
ClientModelState
public ClientModelState()Constructor for ClientModelState class
-
-
Method Details
-
setClientUsername
public void setClientUsername(java.lang.String clientUsername)Description copied from interface:ClientModelUpdaterInterfaceSets the username of this client, which is passed as parameter- Specified by:
setClientUsernamein interfaceClientModelUpdaterInterface- Parameters:
clientUsername- , 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> players)Description copied from interface:ClientModelUpdaterInterfaceSetups players turn order- Specified by:
gameStartedSetupin interfaceClientModelUpdaterInterface- Parameters:
players- , update content
-
getSimplePlayerState
Description copied from interface:ClientStateViewerReturns this client's SimplePlayerState- Specified by:
getSimplePlayerStatein interfaceClientStateViewer- Returns:
- this client's SimplePlayerState
-
getSimplePlayerState
Description copied from interface:ClientStateViewerReturns the SimplePlayerState belonging to the specified player- Specified by:
getSimplePlayerStatein interfaceClientStateViewer- Parameters:
username- , the username of the players whose SimplePlayerState is to be returned- Returns:
- the specified player's SimplePlayerState
-
otherPlayersUsername
public java.util.List<java.lang.String> otherPlayersUsername()Description copied from interface:ClientStateViewerReturns the username list of the players in the game excluded this client's one- Specified by:
otherPlayersUsernamein interfaceClientStateViewer- Returns:
- the username list of the players in the game excluded this client's one
-
usernameList
public java.util.List<java.lang.String> usernameList()Description copied from interface:ClientStateViewerReturns the username list of the players in the game- Specified by:
usernameListin interfaceClientStateViewer- Returns:
- the username list of the players in the game
-
getSimpleGameState
Description copied from interface:ClientStateViewerReturns the SimpleGameState- Specified by:
getSimpleGameStatein interfaceClientStateViewer- Returns:
- the SimpleGameState
-
getPlayerTurnPosition
public int getPlayerTurnPosition()Description copied from interface:ClientStateViewerReturns the position that this client has in the turn list- Specified by:
getPlayerTurnPositionin interfaceClientStateViewer- Returns:
- the position that this client has in the turn list
-
getUsername
public java.lang.String getUsername()Description copied from interface:ClientStateViewerReturns this client's username- Specified by:
getUsernamein interfaceClientStateViewer- Returns:
- this client's username
-