java.lang.Object
it.polimi.ingsw.am13.model.card.points.PointsCorner
- All Implemented Interfaces:
PointsPlayable
,Serializable
Representation of points of a playable card side of the type "x points for each corner covered by this card when you play it"
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
Represents how many points the card gives for each corner it covers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
calcPoints
(CardSidePlayableIF cardSidePlayable, FieldIF field) This method calculates the points given by the card side, according to how many corners it coversboolean
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 pointsRepresents how many points the card gives for each corner it covers
-
-
Constructor Details
-
PointsCorner
public PointsCorner(int points) 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
- how many points the card gives for each corner it covers
-
-
Method Details
-
calcPoints
This method calculates the points given by the card side, according to how many corners it covers- 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()
-