fromChar static method

Rank? fromChar(
  1. String c
)

Create one from text character.

Implementation

static Rank? fromChar(String c) {
  switch (c) {
    case '1':
      return LowAce;
    case '2':
      return Deuce;
    case '3':
      return Trey;
    case '4':
      return Four;
    case '5':
      return Five;
    case '6':
      return Six;
    case '7':
      return Seven;
    case '8':
      return Eight;
    case '9':
      return Nine;
    case 'T':
      return Ten;
    case 'J':
      return Jack;
    case 'C':
      return Knight;
    case 'Q':
      return Queen;
    case 'K':
      return King;
    case 'A':
      return Ace;
    default:
      return null;
  }
}