Class ProfessorOwnership

java.lang.Object
it.polimi.ingsw.eriantys.model.ProfessorOwnership

public class ProfessorOwnership extends Object
This class represents the association between each Color's professor and its respective owner. It exposes a method to get all the professors owned by a Player, two methods to activate and deactivate the effect of the Farmer character card, and a method to update the professors owners after a movement of students.
  • Constructor Details

    • ProfessorOwnership

      public ProfessorOwnership(Supplier<Player> playerSupplier)
  • Method Details

    • getProfessors

      public Set<Color> getProfessors(Player player)
      Returns the Color of the professors owned by player.
      Parameters:
      player - the Player whose professors' colors are returned
      Returns:
      the respective Color of each professor owned by player
    • activateEffect

      public void activateEffect()
      Activates the Farmer character card's effect.
    • deactivateEffect

      public void deactivateEffect()
      Deactivates the Farmer character card's effect.
    • update

      public void update(Set<Color> target)
      Updates the owner for each professor whose respective Color is contained in target.
      Parameters:
      target - the Set of Colors whose respective professors' owners are updated
    • getOwnership

      public Player getOwnership(Color c)
      A helper-getter method to fulfill the BoardStatus creation process.
      Parameters:
      c - the target Color
      Returns:
      a representation for the Player owning the professor of the specified Color