Package it.polimi.ingsw.Model
Class Cloud
java.lang.Object
it.polimi.ingsw.Model.Cloud
- All Implemented Interfaces:
Serializable
The Cloud class is used to replenish pawns in the entrance fields of the
PlayerBoard.getEntranceStudents()
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate ArrayList<PawnColour>
private final int
private static final long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionA Cloud will need to be emptied out, eventually.void
fill
(List<PawnColour> colours) A cloud may need to be filled from time to time. this method is used for thatCloud contents may be inspected without emptying the tile.int
getId()
The ID of the cloud is the index of the array in which the Cloud is stored
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
id
private final int id -
contents
-
-
Constructor Details
-
Cloud
public Cloud(int id) Construct a Cloud, assigning an ID to it.- Parameters:
id
- if the cloud is in an array, the id will be the index of the array at which the cloud is located
-
-
Method Details
-
getId
public int getId()The ID of the cloud is the index of the array in which the Cloud is stored- Returns:
- the ID of the cloud
-
extractContents
A Cloud will need to be emptied out, eventually. This method returns aList
ofPawnColour
and empties the Cloud.- Returns:
- a
List
ofPawnColour
s that were contained in the Cloud - Throws:
EmptyContainerException
- if the Cloud being emptied was already empty, this exception is thrown.
-
getContents
Cloud contents may be inspected without emptying the tile.- Returns:
- an
List.copyOf(Collection)
of the contents of the Cloud
-
fill
A cloud may need to be filled from time to time. this method is used for that- Parameters:
colours
- aList
ofPawnColour
s to put in the Cloud tile- Throws:
FullContainerException
- if the Cloud being filled already had some contents, this exception will be thrown
-