java.lang.Object
it.polimi.ingsw.am13.model.card.CardSideObjectiveActive
- All Implemented Interfaces:
Serializable
Represents the active side (front) of an objective card.
It stores the information about the points guaranteed by the card.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PointsObjective
Information about the points guaranteed by the card this side is part of. -
Constructor Summary
ConstructorsConstructorDescriptionCardSideObjectiveActive
(int points, Color color1, Color color2, Color color3, int pos12, int pos23) Creates a new immutable card side for an objective card of type "x points for each pattern with 3 card in a certain position and with certain colors"CardSideObjectiveActive
(int points, Map<Resource, Integer> set) Creates a new immutable card side for an objective card of type "x points for each set of resources/objects" -
Method Summary
Modifier and TypeMethodDescriptionint
calcPoints
(Field field) Calculates the points guaranteed by the card for the field passed as parameterboolean
int
hashCode()
-
Field Details
-
points
Information about the points guaranteed by the card this side is part of.
-
-
Constructor Details
-
CardSideObjectiveActive
Creates a new immutable card side for an objective card of type "x points for each set of resources/objects"- Parameters:
points
- How many points the card gives for each complete set present in fieldset
- The set of resources/objects that must be present to obtain the points
-
CardSideObjectiveActive
public CardSideObjectiveActive(int points, Color color1, Color color2, Color color3, int pos12, int pos23) throws InvalidCardCreationException Creates a new immutable card side for an objective card of type "x points for each pattern with 3 card in a certain position and with certain colors"- Parameters:
points
- How many points the card gives for each complete non-intersecting pattern is present in fieldcolor1
- Color of upper cardcolor2
- Color of middle cardcolor3
- Color of bottom cardpos12
- Position of middle card with respect to upper card. It can only be -1 (to the left), 0 (right under), 1 (to the right)pos23
- Position of bottom card with respect to middle card. It can only be -1 (to the left), 0 (right under), 1 (to the right)- Throws:
InvalidCardCreationException
- If pos12 or pos23 are not among their possible values
-
-
Method Details
-
getPoints
-
calcPoints
Calculates the points guaranteed by the card for the field passed as parameter- Parameters:
field
- Field of the player for whom you want to calculate the points given by the card.- Returns:
- Number of points guaranteed by the card objective
-
equals
-
hashCode
public int hashCode()
-