Class CardResource

All Implemented Interfaces:
CardIF, CardPlayableIF, Serializable

public class CardResource extends CardPlayable
Represents a resource car, that can be played in player's field sometime during the game. All information about the card and how it is being played are inherited by CardPlayable
See Also:
  • Constructor Details

    • CardResource

      public CardResource(String id, CardSidePlayable front, CardSidePlayable back)
      Creates a new card setting all its immutable attributes The card is created not visible in field
      Parameters:
      id - Id of the card
      front - Front side of the card
      back - Back side of the card
    • CardResource

      public CardResource(String id, Color color, List<Corner> frontCorners, int points) throws InvalidCardCreationException
      Creates a new card setting all immutable attributs. Creates alse the sides
      Parameters:
      id - Id of the card
      color - Color of both sides of the card. Cannot be NO_COLOR
      frontCorners - List of the 4 corners eventually with resources of the front side of the card
      points - Number of points guaranteed by the front side of the card
      Throws:
      InvalidCardCreationException - If the list of corners is not of size 4 or color is NO_COLOR