Class CavePaintings

All Implemented Interfaces:
Serializable

public class CavePaintings extends EventCard
Represents a Cave Paintings event card.

This class defines the specific behavior of the Cave Paintings event.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The minimum number of Artist cards required to avoid the prestige penalty.
    private final int
    The Prestige multiplier applied if the player has at least nLower Artist cards.
    private final int
    The amount of Prestige removed if the player has fewer Artist cards than nLower.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CavePaintings(int Era, int nLower, int nPrestigeRem, int nPrestigeMul)
    Creates a CavePaintings event card with the specified era and effect parameters.
    CavePaintings(String idIMG, int Era, int nLower, int nPrestigeRem, int nPrestigeMul)
    Creates a CavePaintings event card with the specified image id, era and effect parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Activates the CavePaintings event for the specified list of players.
    Creates and returns a copy of this CavePaintings event card.
    Returns the representation shown on the board (offer track cards).
    Prints a string representation of this TribeCard.

    Methods inherited from class EventCard

    getType

    Methods inherited from class TribeCard

    getNMin, isEventCard

    Methods inherited from class PlayableCard

    getEra, getIdIMG

    Methods inherited from class Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • nLower

      private final int nLower
      The minimum number of Artist cards required to avoid the prestige penalty. Also, the bottom number on the card.
    • nPrestigeRem

      private final int nPrestigeRem
      The amount of Prestige removed if the player has fewer Artist cards than nLower.
    • nPrestigeMul

      private final int nPrestigeMul
      The Prestige multiplier applied if the player has at least nLower Artist cards.
  • Constructor Details

    • CavePaintings

      public CavePaintings(int Era, int nLower, int nPrestigeRem, int nPrestigeMul)
      Creates a CavePaintings event card with the specified era and effect parameters.
      Parameters:
      Era - the era of the event card.
      nLower - the minimum number of Artist cards required to avoid the prestige penalty.
      nPrestigeRem - the amount of Prestige removed if the player has fewer Artist cards than nLower.
      nPrestigeMul - the Prestige multiplier applied if the player has at least nLower Artist cards.
    • CavePaintings

      public CavePaintings(String idIMG, int Era, int nLower, int nPrestigeRem, int nPrestigeMul)
      Creates a CavePaintings event card with the specified image id, era and effect parameters.
      Parameters:
      idIMG - the image identifier of the CavePaintings event card.
      Era - the era of the event card.
      nLower - the minimum number of Artist cards required to avoid the prestige penalty.
      nPrestigeRem - the amount of Prestige removed if the player has fewer Artist cards than nLower.
      nPrestigeMul - the Prestige multiplier applied if the player has at least nLower Artist cards.
  • Method Details

    • activateEvent

      public void activateEvent(ArrayList<Player> playerList)
      Activates the CavePaintings event for the specified list of players. For each player, the number of Artist cards is computed together with the number of owned building cards having effect id equal to 9. The player gains Food equal to the number of such buildings multiplied by the number of Artist cards. If the player has fewer Artist cards than nLower, the player loses nPrestigeRem Prestige. Otherwise, the player gains Prestige equal to nPrestigeMul multiplied by the number of Artist cards.
      Specified by:
      activateEvent in class EventCard
      Parameters:
      playerList - the list of players affected by the event.
    • clone

      public EventCard clone()
      Creates and returns a copy of this CavePaintings event card.
      Specified by:
      clone in class EventCard
      Returns:
      a clone of this CavePaintings event card.
    • toStringPlayer

      public String toStringPlayer()
      Prints a string representation of this TribeCard. This specific variation is used in the Game's toString to print a more detailed version.

      NOTE: NUpper is not a real attribute used in calculations (only nLower is needed), however it's a parameter on the cards' design.

      Includes:
      Specified by:
      toStringPlayer in class PlayableCard
      Returns:
      String - a string representation of this TribeCard.
      See Also:
    • toStringBoard

      public String toStringBoard()
      Description copied from class: PlayableCard
      Returns the representation shown on the board (offer track cards).
      Specified by:
      toStringBoard in class PlayableCard
      Returns:
      the board string representation of this card.