java.lang.Object
it.polimi.ingsw.am13.model.card.points.PointsSet
- All Implemented Interfaces:
PointsObjective
,Serializable
Representation of points of an objective card of type "x points for each set of resources/objects"
(first 3 types of objective cards presentd in the rule book).
An object instantiated from this class is immutable.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
calcPoints
(FieldIF field) Calculate points of the card, according to how many sets of resources/objects, which are indicated by the card itself, are visible.boolean
int
getSet()
int
hashCode()
-
Field Details
-
set
Represets the set of resources/objects that must be present to obtain the points -
points
private final int pointsRepresetns how many points the card gives for each complete set present in field
-
-
Constructor Details
-
PointsSet
The only constructor of the class. The only way to set the parameters of the class is to instantiate the object via this constructor- Parameters:
set
- The set of resources/objects that must be present to obtain the pointspoints
- How many points the card gives for each complete set present in field
-
-
Method Details
-
getSet
- Returns:
- The set of resources/objects that must be present to obtain the points
-
calcPoints
Calculate points of the card, according to how many sets of resources/objects, which are indicated by the card itself, are visible.- Specified by:
calcPoints
in interfacePointsObjective
- Parameters:
field
- Field of the player for whom you want to calculate the points given by the card objective.- Returns:
- Number of points guaranteed by the card objective
-
getPointsMultiplier
public int getPointsMultiplier()- Specified by:
getPointsMultiplier
in interfacePointsObjective
- Returns:
- Points multiplier of the objective card (how many points are given for each pattern/set satisfied in the field)
-
equals
-
hashCode
public int hashCode()
-