Class Sustenance

All Implemented Interfaces:
Serializable

public class Sustenance extends EventCard
Represents a Sustenance event card.

This class defines the specific behavior of the Sustenance event.

See Also:
  • Field Details

    • FOOD_PER_GATHERER

      private static final int FOOD_PER_GATHERER
      Food units covered by each Gatherer during the Sustenance event.
      See Also:
    • prestigeDebt

      private final int prestigeDebt
      The prestige penalty multiplier applied for each unpaid Food unit.
  • Constructor Details

    • Sustenance

      public Sustenance(int Era, int prestigeDebt)
      Creates a Sustenance event card with the specified era and prestige debt value.
      Parameters:
      Era - the era of the event card.
      prestigeDebt - the prestige penalty multiplier for unpaid Food units.
    • Sustenance

      public Sustenance(String idIMG, int Era, int prestigeDebt)
      Creates a Sustenance event card with the specified image id, era and prestige debt value.
      Parameters:
      idIMG - the image identifier of the Sustenance event card.
      Era - the era of the event card.
      prestigeDebt - the prestige penalty multiplier for unpaid Food units.
  • Method Details

    • getPrestigeDebt

      public int getPrestigeDebt()
      Returns the prestige penalty multiplier associated with this Sustenance event.
      Returns:
      the prestige penalty multiplier associated with this Sustenance event.
    • activateEvent

      public void activateEvent(ArrayList<Player> playerList)
      Activates the Sustenance event for the specified list of players. For each player, the required Food is computed from the total number of characters, reduced by the contribution of Gatherers and by any applicable character discounts granted by owned building cards with effect id equal to 1. If the resulting Food debt is positive, the player must pay it with available Food. If the player does not have enough Food, all remaining Food is removed and the player loses Prestige equal to the unpaid Food debt multiplied by prestigeDebt. This event is intended to be executed last among event effects.
      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 Sustenance event card.
      Specified by:
      clone in class EventCard
      Returns:
      a clone of this Sustenance 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. 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.