stripWilds static method

List<List<Card>> stripWilds(
  1. List<Card> cards,
  2. Game game
)

Implementation

static List<List<Card>> stripWilds(List<Card> cards, Game game) {
  var wilds = <Card>[];
  var nonWilds = <Card>[];

  for (var card in cards) {
    if (card.rank == -1) {
      wilds.add(card);
    } else {
      nonWilds.add(card);
    }
  }

  return [wilds, nonWilds];
}