Class DiningRoom

java.lang.Object
it.polimi.ingsw.eriantys.model.StudentContainer
it.polimi.ingsw.eriantys.model.DiningRoom

public class DiningRoom extends StudentContainer
This class models a dining room, which is a student container with a maximum capacity of 10 students for every color. The class should only be used as a component of a SchoolBoard.
See Also:
  • Constructor Details

    • DiningRoom

      public DiningRoom()
      Constructs an empty DiningRoom with a capacity of MAX_STUDENTS_PER_COLOR (10) students for each color.
  • Method Details

    • checkForCoins

      public boolean checkForCoins(Color color)
      Returns true if and only if the Player who owns this DiningRoom is entitled to receive a coin based on the number of students of color color it contains.
      Parameters:
      color - the Color whose amount of students is checked.
      Returns:
      true if and only if the Player who owns this DiningRoom is entitled to receive a coin based on the number of students of color color it contains.
    • remainingCapacity

      protected int remainingCapacity(Color color)
      Returns the remaining capacity of the container for the specified Color, an integer between 0 and MAX_STUDENTS_PER_COLOR, or -1 if color is null.
      Overrides:
      remainingCapacity in class StudentContainer
      Parameters:
      color - the color whose remaining capacity is returned.
      Returns:
      the remaining capacity of the container for the specified Color, an integer between 0 and MAX_STUDENTS_PER_COLOR, or -1 if color is null.
      See Also:
      • StudentContainer.remainingCapacity()