Class CardSidePlayable

java.lang.Object
it.polimi.ingsw.am13.model.card.CardSidePlayable
All Implemented Interfaces:
CardSidePlayableIF, Serializable

public class CardSidePlayable extends Object implements CardSidePlayableIF
This class represents one of the two sides of a playable card
See Also:
  • Field Details

    • requirements

      private final Map<Resource,Integer> requirements
      It stores the resources needed to play this card side(it's empty if no resource is required)
    • corners

      private final List<Corner> corners
      It stores the 4 corners of the card side In order, they are: upper left, upper right, lower right, lower left
    • centerResources

      private final List<Resource> centerResources
      This possibly empty list contains the resources at the center of the card side
    • points

      private final PointsPlayable points
      It stores the information needed to calculate the points the player gets when playing this card side
    • color

      private final Color color
      It stores the color of this card
    • id

      private final String id
      Unique id of the card: (r, g, s, o for type), number or 3 digits (in order of pdf).
    • side

      private final Side side
      The side of the card this CardSide corresponds to
  • Constructor Details

    • CardSidePlayable

      public CardSidePlayable(Map<Resource,Integer> requirements, List<Corner> corners, List<Resource> centerResources, PointsPlayable points, Color color, String id, Side side) throws InvalidCardCreationException
      This is the constructor of a cardSidePlayable
      Parameters:
      requirements - the resources needed to play this card side(it's empty if no resource is required)
      corners - the 4 corners of the card side(in order, they are: upper left, upper right, lower right, lower left)
      centerResources - the resources at the center of the card side(it's empty if there are no resources in the center)
      points - the points the player gets when playing this card side(use PointsInstant(0) if the card rewards no points)
      color - the color of this card
      Throws:
      InvalidCardCreationException - If list of corners is not of size 4, or requirements or centerResources contain Resource.NO_RESOURCE
  • Method Details