Card enum cards
Enum for cards and their basic methods. (see Card @ wiki)
Numbers very important here, not just for compatibility but specific algorithms will fail if changed. (see Ordinal @ wiki)
- Inheritance
- Implemented types
Constructors
- Card()
-
const
Values
- None → const Card
- WhiteJoker → const Card
- BlackJoker → const Card
- Joker → const Card
- LowAceOfClubs → const Card
- LowAceOfDiamonds → const Card
- LowAceOfHearts → const Card
- LowAceOfSpades → const Card
- DeuceOfClubs → const Card
- DeuceOfDiamonds → const Card
- DeuceOfHearts → const Card
- DeuceOfSpades → const Card
- TreyOfClubs → const Card
- TreyOfDiamonds → const Card
- TreyOfHearts → const Card
- TreyOfSpades → const Card
- FourOfClubs → const Card
- FourOfDiamonds → const Card
- FourOfHearts → const Card
- FourOfSpades → const Card
- FiveOfClubs → const Card
- FiveOfDiamonds → const Card
- FiveOfHearts → const Card
- FiveOfSpades → const Card
- SixOfClubs → const Card
- SixOfDiamonds → const Card
- SixOfHearts → const Card
- SixOfSpades → const Card
- SevenOfClubs → const Card
- SevenOfDiamonds → const Card
- SevenOfHearts → const Card
- SevenOfSpades → const Card
- EightOfClubs → const Card
- EightOfDiamonds → const Card
- EightOfHearts → const Card
- EightOfSpades → const Card
- NineOfClubs → const Card
- NineOfDiamonds → const Card
- NineOfHearts → const Card
- NineOfSpades → const Card
- TenOfClubs → const Card
- TenOfDiamonds → const Card
- TenOfHearts → const Card
- TenOfSpades → const Card
- JackOfClubs → const Card
- JackOfDiamonds → const Card
- JackOfHearts → const Card
- JackOfSpades → const Card
- KnightOfClubs → const Card
- KnightOfDiamonds → const Card
- KnightOfHearts → const Card
- KnightOfSpades → const Card
- QueenOfClubs → const Card
- QueenOfDiamonds → const Card
- QueenOfHearts → const Card
- QueenOfSpades → const Card
- KingOfClubs → const Card
- KingOfDiamonds → const Card
- KingOfHearts → const Card
- KingOfSpades → const Card
- AceOfClubs → const Card
- AceOfDiamonds → const Card
- AceOfHearts → const Card
- AceOfSpades → const Card
Properties
- fullName → String
-
Full English name
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- highRank → Rank?
-
What's the rank of this card, with low aces made high?
no setter
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- isAce → bool
-
Is this card an ace?
no setter
- isBlack → bool
-
Is this card black? Note that while jokers have no suit, there is a
black one and a red one.
no setter
- isCard → bool
-
Is this an actual card (and not None or an invalid number)?
no setter
- isJoker → bool
-
Is this card a joker?
no setter
- isRed → bool
-
Is this card red? Note that while jokers have no suit, there is a
black one and a red one.
no setter
- rank → Rank?
-
What's the rank of this card? Note that we use a shift on the number
value; that's why the numbers are important. Note that jokers do not
have rank or suit.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- suit → Suit?
-
What's the suit of this card? Jokers have no suit.
no setter
Methods
-
compareTo(
Card other) → int -
Compares this object to another object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
toText(
) → String - Render to two-character text in standard format
-
toUnicode(
) → String - Render to two-character text with unicode suit symbols
-
toUnicodeSingle(
) → String - Render to single-character unicode card image.
Operators
-
operator <(
Card other) → bool -
operator <=(
Card other) → bool -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >(
Card other) → bool -
operator >=(
Card other) → bool
Static Properties
-
unicodeSingles
→ List<
String> -
final
Static Methods
-
fromInt(
int v) → Card? - Create one from integer value
-
fromRankSuit(
Rank r, Suit s) → Card - Create one from rank and suit
-
fromText(
String text) → Card? - Create one from text representation
-
highAceFix(
Card c) → Card - Make low aces high, leave other cards alone
-
lowAceFix(
Card c) → Card - Make high aces low, leave other cards alone