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
-
Field Summary
FieldsFields inherited from class it.polimi.ingsw.server.model.game_logic.SchoolBoard
deck, diningRoomLaneColorToNumberOfStudents, id, professorsTable, studentsInTheEntrance, towerColor -
Constructor Summary
ConstructorsConstructorDescriptionExpertSchoolBoard(int id, List<Color> studentsInTheEntrance, TowerColor towerColor, int initialCoins) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddStudentToDiningRoom(Color student) This method adds the inputted student to the diningRoom, adding a coin to the schoolBoard in certain conditionsintgetCoins()This method returns the amount of coins that the schoolBoard haslightify()This method returns the light version of the schoolBoard, containing all the useful information that need to be sent over the networkvoidpayCharacter(int cost) This method is used to pay for the characters that may be activated during a gamevoidremoveStudentFromDiningRoom(Color student) This method removes the inputted student from the diningRoomMethods inherited from class it.polimi.ingsw.server.model.game_logic.SchoolBoard
addProfessor, addStudentToEntrance, containsAllStudentsInTheDiningRoom, containsAllStudentsInTheEntrance, getDeck, getDiningRoomLaneColorToNumberOfStudents, getId, getProfessors, getStudentsInTheEntrance, getTowerColor, grabStudentsFromCloud, isInTheEntrance, moveFromEntranceToDiningRoom, playCard, removeProfessor, removeStudentFromEntrance
-
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 gamestudentsInTheEntrance- students to put in the entrance of the schoolboardtowerColor- tower color of this schoolboard- Throws:
IllegalArgumentException- if studentsInTheEntrance == null or studentsInTheEntrance contains null
-
-
Method Details
-
addStudentToDiningRoom
This method adds the inputted student to the diningRoom, adding a coin to the schoolBoard in certain conditions- Overrides:
addStudentToDiningRoomin classSchoolBoard- 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
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
This method returns the light version of the schoolBoard, containing all the useful information that need to be sent over the network- Overrides:
lightifyin classSchoolBoard- Returns:
- the light version of the schoolBoard, containing all the useful information that need to be sent over the network
-