rank property

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.

Implementation

Rank? get rank {
  if (index < Card.LowAceOfClubs.index || index > Card.AceOfSpades.index) {
    return null;
  }
  return Rank.values[index >> 2];
}