@Cards-TS
    Preparing search index...

    Class to represent cards in a deck

    Index

    Constructors

    • Create a new card

      Parameters

      • suit: Suit

        the suit of the card

      • rank: Rank

        the rank of the card

      • deck: number = -1

        reference information about the deck this card belongs to (not required)

      • jokerNum: number = -1

        reference information to designate two jokers belonging to a single deck (not required)

      Returns Card

    Properties

    deck: number = -1

    reference information about the deck this card belongs to (not required)

    rank: Rank

    the rank of the card

    suit: Suit

    the suit of the card

    type: "card" = 'card'

    Methods

    • Tells whether two cards are equivalent, accounting for a 'template card' not containing deck or joker reference

      Parameters

      • Optionalother: any

        the card to compare to

      Returns boolean

      if the cards are equivalent

    • Orders cards by rank and then by suit, ignoring deck and joker number

      Parameters

      • one: Card

        the first card

      • two: Card

        the second card

      Returns number

      -1 if the first card comes first, 1 if the second card comes first, or 0 otherwise

    • Create a card from an object containing the normal fields

      Parameters

      • obj: any

        the object to grab attributes from

      Returns Card

      the card

    • Create a card from a string representation

      Parameters

      • str: string

        the string to create the card from

      • deck: number = -1

      Returns Card

      the card