Class Card

java.lang.Object
moe.maika.ygofm.gamedata.Card

public class Card extends Object
A representation of a card in Forbidden Memories. Use FMDB.getCard(int) and related methods to obtain card instances. The card instances are immutable and thread-safe.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether this card can be equipped with the given equip card.
    boolean
    equips(Card monster)
    Returns whether this equip card can be successfully equipped to the given monster.
    Returns the result of fusing this card with another card, or null if no fusion is possible.
    fuseWith(Card other)
    Returns the result of fusing this card with another card.
    int
    Returns the ordinal value of this card in the full list of cards when sorted alphabetically.
    int
    Returns the ordinal value of this card in the full list of cards when sorted by its AI sort value.
    int
    Returns the ordinal value of this card in the full list of cards when sorted by its attack points.
    int
    Returns the attack points of the card.
    Returns the attribute of the card.
    int
    Returns the defense points of the card.
    int
    Returns the ordinal value of this card in the full list of cards when sorted by its defense points.
    Returns the in-game description of the card, with line-breaks preserved.
    Returns the primary Guardian Star of the card.
    int
    Returns the ID of the card.
    int
    Returns the ordinal value of this card in the full list of cards when sorted lexicographically in Japanese.
    int
    Returns the ordinal value of this card in the full list of cards when sorted by its attack points in Japanese release.
    int
    Returns the ordinal value of this card in the full list of cards when sorted by its defense points in Japanese release.
    int
    Returns the ordinal value of this card in the full list of cards when sorted by its max sort value in Japanese release.
    int
    Returns the ordinal value of this card in the full list of cards when sorted by its type in Japanese release.
    int
    Returns the level of the card.
    int
    Returns the ordinal value of this card in the full list of cards when sorted by its max sort value.
    Returns the name of the card.
    Returns the password of the card.
    Returns the secondary Guardian Star of the card.
    int
    Returns the starchip cost of the card.
    Returns the type of the card.
    int
    Returns the ordinal value of this card in the full list of cards when sorted by its type.
    Returns the name of the card

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • getId

      public int getId()
      Returns the ID of the card.
      Returns:
      the ID of the card
    • getName

      public String getName()
      Returns the name of the card.
      Returns:
      the name of the card
    • getStarchips

      public int getStarchips()
      Returns the starchip cost of the card.
      Returns:
      the starchip cost of the card
    • getLevel

      public int getLevel()
      Returns the level of the card.
      Returns:
      the level of the card
    • getAttack

      public int getAttack()
      Returns the attack points of the card.
      Returns:
      the attack of the card
    • getDefense

      public int getDefense()
      Returns the defense points of the card.
      Returns:
      the defense of the card
    • getFirstGuardianStar

      public GuardianStar getFirstGuardianStar()
      Returns the primary Guardian Star of the card.
      Returns:
      the pirst Guardian Star of the card
    • getSecondGuardianStar

      public GuardianStar getSecondGuardianStar()
      Returns the secondary Guardian Star of the card.
      Returns:
      the secondary Guardian Star of the card
    • getDescription

      public String getDescription()
      Returns the in-game description of the card, with line-breaks preserved.
      Returns:
      the description of the card
    • getType

      public String getType()
      Returns the type of the card. See fields in FMDB for possible values.
      Returns:
      the type of the card
    • getAttribute

      public String getAttribute()
      Returns the attribute of the card.
      Returns:
      the attribute of the card
    • getPassword

      public String getPassword()
      Returns the password of the card.
      Returns:
      the password of the card
    • getAbcSort

      public int getAbcSort()
      Returns the ordinal value of this card in the full list of cards when sorted alphabetically.
      Returns:
      the ABC sort value of the card
    • getMaxSort

      public int getMaxSort()
      Returns the ordinal value of this card in the full list of cards when sorted by its max sort value.
      Returns:
      the max sort value of the card
    • getAtkSort

      public int getAtkSort()
      Returns the ordinal value of this card in the full list of cards when sorted by its attack points.
      Returns:
      the attack sort value of the card
    • getDefSort

      public int getDefSort()
      Returns the ordinal value of this card in the full list of cards when sorted by its defense points.
      Returns:
      the defense sort value of the card
    • getTypeSort

      public int getTypeSort()
      Returns the ordinal value of this card in the full list of cards when sorted by its type.
      Returns:
      the type sort value of the card
    • getAiSort

      public int getAiSort()
      Returns the ordinal value of this card in the full list of cards when sorted by its AI sort value.
      Returns:
      the AI sort value of the card
    • getJpAbcSort

      public int getJpAbcSort()
      Returns the ordinal value of this card in the full list of cards when sorted lexicographically in Japanese.
      Returns:
      the Japanese ABC sort value of the card
    • getJpMaxSort

      public int getJpMaxSort()
      Returns the ordinal value of this card in the full list of cards when sorted by its max sort value in Japanese release.
      Returns:
      the Japanese max sort value of the card
    • getJpAtkSort

      public int getJpAtkSort()
      Returns the ordinal value of this card in the full list of cards when sorted by its attack points in Japanese release.
      Returns:
      the Japanese attack sort value of the card
    • getJpDefSort

      public int getJpDefSort()
      Returns the ordinal value of this card in the full list of cards when sorted by its defense points in Japanese release.
      Returns:
      the Japanese defense sort value of the card
    • getJpTypeSort

      public int getJpTypeSort()
      Returns the ordinal value of this card in the full list of cards when sorted by its type in Japanese release.
      Returns:
      the Japanese type sort value of the card
    • canBeEquippedWith

      public boolean canBeEquippedWith(Card equip)
      Returns whether this card can be equipped with the given equip card. Use equips(Card) for the inverse.
      Parameters:
      equip - the equip card
      Returns:
      true if this card can be equipped with the given equip card
      Throws:
      IllegalArgumentException - if this card is not a monster, the given card is not an equip card, or either card is null
    • equips

      public boolean equips(Card monster)
      Returns whether this equip card can be successfully equipped to the given monster. Use canBeEquippedWith(Card) for the inverse.
      Parameters:
      monster - the monster to check whether it takes this equip card
      Returns:
      true if the monster can take this equip card
      Throws:
      IllegalArgumentException - if this card is not an equip or the given card is not a monster
    • fuseWith

      public Card fuseWith(Card other)
      Returns the result of fusing this card with another card. If no fusion is possible, the given card is returned, not this card. This behavior mirrors the in-game mechanic when selecting two cards to fuse.
      Parameters:
      other - the other card to fuse with
      Returns:
      the result of fusing the two cards, or the other card if no fusion is possible
      Throws:
      IllegalArgumentException - if the other card is null
    • fuseOrNull

      public Card fuseOrNull(Card other)
      Returns the result of fusing this card with another card, or null if no fusion is possible.
      Parameters:
      other - the other card to fuse with
      Returns:
      the result of fusing the two cards, or null if no fusion is possible
      Throws:
      IllegalArgumentException - if either card is null
    • toString

      public String toString()
      Returns the name of the card
      Overrides:
      toString in class Object
      Returns:
      the name of the card