Class Inventor

All Implemented Interfaces:
Serializable, Cloneable

public class Inventor extends Character
Represents an Inventor character card.

An Inventor is a specific type of Character initialized with CharacterType.INVENTOR.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The Icons's ID.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Inventor(int Era, int icon)
    Creates an Inventor character card with the specified era and icon value.
    Inventor(int Era, int icon, int nMin)
    Creates an Inventor character card with the specified era, icon value, and minimum number of players.
    Inventor(String idIMG, int Era, int icon)
    Creates an Inventor character card with the specified image id, era and icon value.
    Inventor(String idIMG, int Era, int icon, int nMin)
    Creates an Inventor character card with the specified image id, era, icon value, and minimum number of players.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates and returns a copy of this Inventor card.
    int
    Returns the icon value of this Inventor card.
    void
    insert(Player player)
    Inserts this Inventor card into the specified player's Inventor collection.
    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

    • icon

      private final int icon
      The Icons's ID. There are a total of 10 different Icons.
  • Constructor Details

    • Inventor

      public Inventor(int Era, int icon) throws IllegalArgumentException
      Creates an Inventor character card with the specified era and icon value.
      Parameters:
      Era - the era of the Inventor card.
      icon - the icon value of the Inventor card.
      Throws:
      IllegalArgumentException - if icon < 0 or icon > 9.
    • Inventor

      public Inventor(int Era, int icon, int nMin) throws IllegalArgumentException
      Creates an Inventor character card with the specified era, icon value, and minimum number of players.
      Parameters:
      Era - the era of the Inventor card.
      icon - the icon value of the Inventor card.
      nMin - the minimum number of players required for the card.
      Throws:
      IllegalArgumentException - if icon < 0 or icon > 9.
    • Inventor

      public Inventor(String idIMG, int Era, int icon) throws IllegalArgumentException
      Creates an Inventor character card with the specified image id, era and icon value.
      Parameters:
      idIMG - the image identifier of the Inventor card.
      Era - the era of the Inventor card.
      icon - the icon value of the Inventor card.
      Throws:
      IllegalArgumentException - if icon < 0 or icon > 9.
    • Inventor

      public Inventor(String idIMG, int Era, int icon, int nMin) throws IllegalArgumentException
      Creates an Inventor character card with the specified image id, era, icon value, and minimum number of players.
      Parameters:
      idIMG - the image identifier of the Inventor card.
      Era - the era of the Inventor card.
      icon - the icon value of the Inventor card.
      nMin - the minimum number of players required for the card.
      Throws:
      IllegalArgumentException - if icon < 0 or icon > 9.
  • Method Details

    • getIcon

      public int getIcon()
      Returns the icon value of this Inventor card.
      Returns:
      the icon value of this Inventor 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 Inventor card.
      Specified by:
      clone in class Character
      Returns:
      a clone of this Inventor card.
    • insert

      public void insert(Player player)
      Inserts this Inventor card into the specified player's Inventor collection.

      The method also applies the building effects related to inventor pairs and any building effects triggered by character set completion.

      Specified by:
      insert in class Character
      Parameters:
      player - the player who receives the card.