Package it.polimi.ingsw.view
Class SimplePlayerState
java.lang.Object
it.polimi.ingsw.view.SimplePlayerState
public class SimplePlayerState
extends java.lang.Object
Class containing a simplified version of the PlayerBoard state
-
Constructor Summary
Constructors Constructor Description SimplePlayerState()Constructor for SimplePlayerState class -
Method Summary
Modifier and Type Method Description voidactivatedLeaderUpdate(LeaderUpdate stateUpdate)Updates the LeaderCards activating one themvoidcardSlotUpdate(CardSlotUpdate stateUpdate)Updates the CardSlotsvoidchestUpdate(ChestUpdate stateUpdate)Updates the chestvoiddiscardLeader(int indexOfLeaderToDiscard)discard a LeaderCard from the SimplePlayerStatejava.util.List<java.lang.Integer>getActiveLeaderCards()Returns active LeaderCards present in this SimplePlayerStatejava.util.List<java.lang.Integer>[]getCardSlots()java.util.Map<ResourceType,java.lang.Integer>getChest()Returns the chestjava.util.List<Pair<ResourceType,java.lang.Integer>>getLeaderLevels()Returns levels of the warehouse that belongs to LeaderCards NOTE: can return nulljava.util.List<java.lang.Integer>getNotActiveLeaderCards()return non-active leader cards NOTE: can return nulljava.util.List<java.lang.Integer>getProducibleCardSlotsId()Returns the ids of the develop cards on which the player can activate the production onjava.util.List<java.lang.Integer>getProducibleLeaders()Returns the ids of the leader cards on which the player can activate the production onintgetTrackPosition()boolean[]getVaticanFlipped()Pair<ResourceType,java.lang.Integer>[]getWarehouseLevels()Returns normal levels of warehouse (so excluding leader levels if they are present)voidmergeTempChest()Merges the temporary chest of this SimplePlayerState into his chestvoidsetupLeaderCard(LeaderSetup stateSetup)Setups non activated LeaderCardsvoidtempChestUpdate(ChestUpdate stateUpdate)Updates the temporary chestvoidtrackUpdate(TrackUpdate stateUpdate)Updates the trackvoidvaticanReportUpdate(VaticanReport stateUpdate)Updates the vatican report cellsvoidwarehouseUpdate(WarehouseUpdate update)Updates the warehouse LeaderCards that works as a warehouse level are also updated with this methodMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
SimplePlayerState
public SimplePlayerState()Constructor for SimplePlayerState class
-
-
Method Details
-
setupLeaderCard
Setups non activated LeaderCards- Parameters:
stateSetup- , contains the list of LeaderCards that belong to this SimplePlayer
-
warehouseUpdate
Updates the warehouse LeaderCards that works as a warehouse level are also updated with this method- Parameters:
update- , update content
-
trackUpdate
Updates the track- Parameters:
stateUpdate- , update content
-
vaticanReportUpdate
Updates the vatican report cells- Parameters:
stateUpdate- , update content
-
chestUpdate
Updates the chest- Parameters:
stateUpdate- , update content
-
tempChestUpdate
Updates the temporary chest- Parameters:
stateUpdate- , update content
-
cardSlotUpdate
Updates the CardSlots- Parameters:
stateUpdate- , update content
-
activatedLeaderUpdate
Updates the LeaderCards activating one them- Parameters:
stateUpdate- , update content
-
discardLeader
public void discardLeader(int indexOfLeaderToDiscard)discard a LeaderCard from the SimplePlayerState- Parameters:
indexOfLeaderToDiscard- , index of the leader to discard (starting at 0)
-
getNotActiveLeaderCards
public java.util.List<java.lang.Integer> getNotActiveLeaderCards()return non-active leader cards NOTE: can return null- Returns:
- non-active leader cards
-
getChest
Returns the chest- Returns:
- the chest
-
getWarehouseLevels
Returns normal levels of warehouse (so excluding leader levels if they are present)- Returns:
- normal levels of warehouse
-
getLeaderLevels
Returns levels of the warehouse that belongs to LeaderCards NOTE: can return null- Returns:
- levels of the warehouse that belongs to LeaderCards
-
getTrackPosition
public int getTrackPosition() -
getCardSlots
public java.util.List<java.lang.Integer>[] getCardSlots() -
getVaticanFlipped
public boolean[] getVaticanFlipped() -
getActiveLeaderCards
public java.util.List<java.lang.Integer> getActiveLeaderCards()Returns active LeaderCards present in this SimplePlayerState- Returns:
- active LeaderCards present in this SimplePlayerState
-
getProducibleLeaders
public java.util.List<java.lang.Integer> getProducibleLeaders()Returns the ids of the leader cards on which the player can activate the production on- Returns:
- the ids of the leader cards on which the player can activate the production on
-
getProducibleCardSlotsId
public java.util.List<java.lang.Integer> getProducibleCardSlotsId()Returns the ids of the develop cards on which the player can activate the production on- Returns:
- the ids of the develop cards on which the player can activate the production on
-
mergeTempChest
public void mergeTempChest()Merges the temporary chest of this SimplePlayerState into his chest
-