java.lang.Object
it.polimi.ingsw.am13.model.card.points.PointsResource
- All Implemented Interfaces:
PointsPlayable
,Serializable
Representation of points of a playable card side of the type
"x points for each resource of type y present on the field immediately after you play it"
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPointsResource
(int points, Resource resource) The only constructor of the class. -
Method Summary
Modifier and TypeMethodDescriptionint
calcPoints
(CardSidePlayableIF cardSidePlayable, FieldIF field) This method calculates the points given by the card side, according to how many resources of the required type, which is indicated on the card itself, are visible.boolean
int
Return the points multiplier.Return the required resource to get points by playing the card.int
hashCode()
boolean
Returns true if the number of points is conditioned to the number of angles the card covers.
-
Field Details
-
points
private final int pointsThis variable represents the number of points this card gives for each resource -
resource
This variable represents the resource required to get points by playing this card
-
-
Constructor Details
-
PointsResource
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:
points
- the amount of points this card gives for each resourceresource
- the resource required to get points by playing this card
-
-
Method Details
-
calcPoints
This method calculates the points given by the card side, according to how many resources of the required type, which is indicated on the card itself, are visible.- Specified by:
calcPoints
in interfacePointsPlayable
- Parameters:
cardSidePlayable
- side of the playable card that gives these points to the playerfield
- Field of the player for whom you want to calculate the points given by the card objective.- Returns:
- the number of points the player receives after playing this card
-
getPointsMultiplier
public int getPointsMultiplier()Description copied from interface:PointsPlayable
Return the points multiplier. In other words, the number of points which appears on the card.- Specified by:
getPointsMultiplier
in interfacePointsPlayable
- Returns:
- Points multiplier
-
getPointsResource
Description copied from interface:PointsPlayable
Return the required resource to get points by playing the card.- Specified by:
getPointsResource
in interfacePointsPlayable
- Returns:
- Resource required
-
isCornerTypePoints
public boolean isCornerTypePoints()Description copied from interface:PointsPlayable
Returns true if the number of points is conditioned to the number of angles the card covers.- Specified by:
isCornerTypePoints
in interfacePointsPlayable
- Returns:
- true if PointsCorner, false otherwise
-
equals
-
hashCode
public int hashCode()
-