Class PointsCorner

java.lang.Object
it.polimi.ingsw.am13.model.card.points.PointsCorner
All Implemented Interfaces:
PointsPlayable, Serializable

public class PointsCorner extends Object implements PointsPlayable
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 Details

    • points

      private final int points
      Represents 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

      public int calcPoints(CardSidePlayableIF cardSidePlayable, FieldIF field)
      This method calculates the points given by the card side, according to how many corners it covers
      Specified by:
      calcPoints in interface PointsPlayable
      Parameters:
      cardSidePlayable - side of the playable card that gives these points to the player
      field - 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 interface PointsPlayable
      Returns:
      Points multiplier
    • getPointsResource

      public Resource getPointsResource()
      Description copied from interface: PointsPlayable
      Return the required resource to get points by playing the card.
      Specified by:
      getPointsResource in interface PointsPlayable
      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 interface PointsPlayable
      Returns:
      true if PointsCorner, false otherwise
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object