Class Builder

All Implemented Interfaces:
Serializable, Cloneable

public class Builder extends Character
Represents a Builder character card.

A Builder is a specific type of Character that provides a reduction value when buying building cards.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The prestige value provided by this Builder card.
    private final int
    The reduction value provided by this Builder card.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Builder(int Era, int reductionValue, int prestigeValue)
    Creates a Builder character card with the specified era, reduction value, and prestige value.
    Builder(int Era, int reductionValue, int prestigeValue, int nMin)
    Creates a Builder character card with the specified era, reduction value, prestige value, and minimum number of players.
    Builder(String idIMG, int Era, int reductionValue, int prestigeValue)
    Creates a Builder character card with the specified era, reduction value, and prestige value.
    Builder(String idIMG, int Era, int reductionValue, int prestigeValue, int nMin)
    Creates a Builder character card with the specified era, reduction value, prestige value, and minimum number of players.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates and returns a copy of this Builder card.
    int
    Returns the prestige value of this Builder card.
    int
    Returns the reduction value of this Builder card.
    void
    insert(Player player)
    Inserts this Builder card into the specified player's Builder collection and applies any building effects triggered by character set completion.
    Returns the representation shown on the board (offer track cards).
    Returns the compact representation shown in the player hand panel.

    Methods inherited from class Character

    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

    • reductionValue

      private final int reductionValue
      The reduction value provided by this Builder card.
    • prestigeValue

      private final int prestigeValue
      The prestige value provided by this Builder card.
  • Constructor Details

    • Builder

      public Builder(int Era, int reductionValue, int prestigeValue) throws IllegalArgumentException
      Creates a Builder character card with the specified era, reduction value, and prestige value.
      Parameters:
      Era - the era of the Builder card.
      reductionValue - the reduction value of the Builder card.
      prestigeValue - the prestige value of the Builder card.
      Throws:
      IllegalArgumentException - if reductionValue < 0 or prestigeValue < 0.
    • Builder

      public Builder(int Era, int reductionValue, int prestigeValue, int nMin) throws IllegalArgumentException
      Creates a Builder character card with the specified era, reduction value, prestige value, and minimum number of players.
      Parameters:
      Era - the era of the Builder card.
      reductionValue - the reduction value of the Builder card.
      prestigeValue - the prestige value of the Builder card.
      nMin - the minimum number of players required for the card.
      Throws:
      IllegalArgumentException - if reductionValue < 0 or prestigeValue < 0.
    • Builder

      public Builder(String idIMG, int Era, int reductionValue, int prestigeValue) throws IllegalArgumentException
      Creates a Builder character card with the specified era, reduction value, and prestige value.
      Parameters:
      idIMG - the image identifier of the Builder card.
      Era - the era of the Builder card.
      reductionValue - the reduction value of the Builder card.
      prestigeValue - the prestige value of the Builder card.
      Throws:
      IllegalArgumentException - if reductionValue < 0 or prestigeValue < 0.
    • Builder

      public Builder(String idIMG, int Era, int reductionValue, int prestigeValue, int nMin) throws IllegalArgumentException
      Creates a Builder character card with the specified era, reduction value, prestige value, and minimum number of players.
      Parameters:
      idIMG - the image identifier of the Builder card.
      Era - the era of the Builder card.
      reductionValue - the reduction value of the Builder card.
      prestigeValue - the prestige value of the Builder card.
      nMin - the minimum number of players required for the card.
      Throws:
      IllegalArgumentException - if reductionValue < 0 or prestigeValue < 0.
  • Method Details

    • getReductionValue

      public int getReductionValue()
      Returns the reduction value of this Builder card.
      Returns:
      the reduction value of this Builder card.
    • getPrestigeValue

      public int getPrestigeValue()
      Returns the prestige value of this Builder card.
      Returns:
      the prestige value of this Builder card.
    • toStringPlayer

      public String toStringPlayer()
      Description copied from class: PlayableCard
      Returns the compact representation shown in the player hand panel.
      Specified by:
      toStringPlayer in class PlayableCard
      Returns:
      the player-hand string representation of this card.
    • 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.
    • clone

      public Character clone()
      Creates and returns a copy of this Builder card.
      Specified by:
      clone in class Character
      Returns:
      a clone of this Builder card.
    • insert

      public void insert(Player player)
      Inserts this Builder card into the specified player's Builder collection and applies any building effects triggered by character set completion.
      Specified by:
      insert in class Character
      Parameters:
      player - the player who receives the card.