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 Details

    • SimplePlayerState

      public SimplePlayerState()
      Constructor for SimplePlayerState class
  • Method Details

    • setupLeaderCard

      public void setupLeaderCard​(LeaderSetup stateSetup)
      Setups non activated LeaderCards
      Parameters:
      stateSetup - , contains the list of LeaderCards that belong to this SimplePlayer
    • warehouseUpdate

      public void warehouseUpdate​(WarehouseUpdate update)
      Updates the warehouse LeaderCards that works as a warehouse level are also updated with this method
      Parameters:
      update - , update content
    • trackUpdate

      public void trackUpdate​(TrackUpdate stateUpdate)
      Updates the track
      Parameters:
      stateUpdate - , update content
    • vaticanReportUpdate

      public void vaticanReportUpdate​(VaticanReport stateUpdate)
      Updates the vatican report cells
      Parameters:
      stateUpdate - , update content
    • chestUpdate

      public void chestUpdate​(ChestUpdate stateUpdate)
      Updates the chest
      Parameters:
      stateUpdate - , update content
    • tempChestUpdate

      public void tempChestUpdate​(ChestUpdate stateUpdate)
      Updates the temporary chest
      Parameters:
      stateUpdate - , update content
    • cardSlotUpdate

      public void cardSlotUpdate​(CardSlotUpdate stateUpdate)
      Updates the CardSlots
      Parameters:
      stateUpdate - , update content
    • activatedLeaderUpdate

      public void activatedLeaderUpdate​(LeaderUpdate stateUpdate)
      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

      public java.util.Map<ResourceType,​java.lang.Integer> getChest()
      Returns the chest
      Returns:
      the chest
    • getWarehouseLevels

      public Pair<ResourceType,​java.lang.Integer>[] getWarehouseLevels()
      Returns normal levels of warehouse (so excluding leader levels if they are present)
      Returns:
      normal levels of warehouse
    • getLeaderLevels

      public java.util.List<Pair<ResourceType,​java.lang.Integer>> 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