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
ConstructorDescriptionConstructs an emptyDiningRoom
with a capacity ofMAX_STUDENTS_PER_COLOR
(10) students for each color. -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkForCoins
(Color color) Returnstrue
if and only if thePlayer
who owns thisDiningRoom
is entitled to receive a coin based on the number of students of colorcolor
it contains.protected int
remainingCapacity
(Color color) Returns the remaining capacity of the container for the specifiedColor
, an integer between 0 andMAX_STUDENTS_PER_COLOR
, or-1
ifcolor
isnull
.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 emptyDiningRoom
with a capacity ofMAX_STUDENTS_PER_COLOR
(10) students for each color.
-
-
Method Details
-
checkForCoins
Returnstrue
if and only if thePlayer
who owns thisDiningRoom
is entitled to receive a coin based on the number of students of colorcolor
it contains. -
remainingCapacity
Returns the remaining capacity of the container for the specifiedColor
, an integer between 0 andMAX_STUDENTS_PER_COLOR
, or-1
ifcolor
isnull
.- Overrides:
remainingCapacity
in 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-1
ifcolor
isnull
. - See Also:
-
StudentContainer.remainingCapacity()
-