java.lang.Object
it.polimi.ingsw.am13.model.card.points.PointsInstant
- All Implemented Interfaces:
PointsPlayable
,Serializable
Representation of points of a playable card side of the type "x points when you play this card on this side"
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
This variable represents how many points the card gives -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
calcPoints
(CardSidePlayableIF cardSide, FieldIF field) This method returns the points given by the card sideboolean
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 how many points the card gives
-
-
Constructor Details
-
PointsInstant
public PointsInstant(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
-
-
Method Details
-
calcPoints
This method returns the points given by the card side- Specified by:
calcPoints
in interfacePointsPlayable
- Parameters:
cardSide
- 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:
- how many points the card gives
-
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()
-