Class ExpertSchoolBoard

java.lang.Object
it.polimi.ingsw.server.model.game_logic.SchoolBoard
it.polimi.ingsw.server.model.game_logic.ExpertSchoolBoard
All Implemented Interfaces:
SchoolBoardCommonInterface

public class ExpertSchoolBoard extends SchoolBoard
  • Field Details

    • coins

      int coins
  • Constructor Details

    • ExpertSchoolBoard

      public ExpertSchoolBoard(int id, List<Color> studentsInTheEntrance, TowerColor towerColor, int initialCoins)
      Parameters:
      id - must be a unique id for this schoolboard in this game
      studentsInTheEntrance - students to put in the entrance of the schoolboard
      towerColor - tower color of this schoolboard
      Throws:
      IllegalArgumentException - if studentsInTheEntrance == null or studentsInTheEntrance contains null
  • Method Details

    • addStudentToDiningRoom

      protected void addStudentToDiningRoom(Color student) throws FullDiningRoomLaneException
      This method adds the inputted student to the diningRoom, adding a coin to the schoolBoard in certain conditions
      Overrides:
      addStudentToDiningRoom in class SchoolBoard
      Parameters:
      student - is the student that will be added to the diningRoom
      Throws:
      FullDiningRoomLaneException - if the diningRoom table corresponding to the inputted student is already full
    • payCharacter

      public void payCharacter(int cost)
      This method is used to pay for the characters that may be activated during a game
      Parameters:
      cost - is the cost of the character that will be activated
    • getCoins

      public int getCoins()
      This method returns the amount of coins that the schoolBoard has
      Returns:
      an int representing the amount of coins that the schoolBoard has
    • removeStudentFromDiningRoom

      public void removeStudentFromDiningRoom(Color student) throws StudentsNotInTheDiningRoomException
      This method removes the inputted student from the diningRoom
      Parameters:
      student - is the student that will be removed from the diningRoom
      Throws:
      StudentsNotInTheDiningRoomException - if the inputted student is not actually present in the diningRoom
    • lightify

      public LightSchoolBoard lightify()
      This method returns the light version of the schoolBoard, containing all the useful information that need to be sent over the network
      Overrides:
      lightify in class SchoolBoard
      Returns:
      the light version of the schoolBoard, containing all the useful information that need to be sent over the network