Package it.polimi.ingsw.eriantys.model
Class DiningRoom
java.lang.Object
it.polimi.ingsw.eriantys.model.StudentContainer
it.polimi.ingsw.eriantys.model.DiningRoom
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 Summary
ConstructorsConstructorDescriptionConstructs an emptyDiningRoomwith a capacity ofMAX_STUDENTS_PER_COLOR(10) students for each color. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckForCoins(Color color) Returnstrueif and only if thePlayerwho owns thisDiningRoomis entitled to receive a coin based on the number of students of colorcolorit contains.protected intremainingCapacity(Color color) Returns the remaining capacity of the container for the specifiedColor, an integer between 0 andMAX_STUDENTS_PER_COLOR, or-1ifcolorisnull.Methods inherited from class it.polimi.ingsw.eriantys.model.StudentContainer
empty, fill, getQuantity, getRepresentation, moveAllTo, moveTo, moveTo, refillFrom, swap
-
Constructor Details
-
DiningRoom
public DiningRoom()Constructs an emptyDiningRoomwith a capacity ofMAX_STUDENTS_PER_COLOR(10) students for each color.
-
-
Method Details
-
checkForCoins
Returnstrueif and only if thePlayerwho owns thisDiningRoomis entitled to receive a coin based on the number of students of colorcolorit contains. -
remainingCapacity
Returns the remaining capacity of the container for the specifiedColor, an integer between 0 andMAX_STUDENTS_PER_COLOR, or-1ifcolorisnull.- Overrides:
remainingCapacityin classStudentContainer- Parameters:
color- the color whose remaining capacity is returned.- Returns:
- the remaining capacity of the container for the specified
Color, an integer between 0 andMAX_STUDENTS_PER_COLOR, or-1ifcolorisnull. - See Also:
-
StudentContainer.remainingCapacity()
-