Package it.polimi.ingsw.eriantys.model
Class Bag
java.lang.Object
it.polimi.ingsw.eriantys.model.StudentContainer
it.polimi.ingsw.eriantys.model.Bag
This class models the actual bag in the board game, which initially contains all the students discs.
It exposes a method which returns a list of
Color, used during the game setup.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBag()Constructs an emptyBag, then fills it with 26 students for each color, 130 total. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEmpty()A method which states if theBagis empty.protected intremainingCapacity(Color color) Returns the remaining capacity of the container for the specifiedColor, an integer between 0 andMAX_STUDENTS_PER_COLOR, or-1ifcolorisnull.Sets up the islands at the start of the game.Methods inherited from class it.polimi.ingsw.eriantys.model.StudentContainer
empty, fill, getQuantity, getRepresentation, moveAllTo, moveTo, moveTo, refillFrom, swap
-
Constructor Details
-
Bag
public Bag()Constructs an emptyBag, then fills it with 26 students for each color, 130 total.- See Also:
-
-
Method Details
-
setupDraw
Sets up the islands at the start of the game.- Returns:
- a list containing two students of each
Colorin random order - See Also:
-
isEmpty
public boolean isEmpty()A method which states if theBagis empty.- Returns:
trueif and only if the object is empty
-
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()
-