find method
Looks up a card in this collection by its cardSet
and orderInSet
.
If the card is not found, throws a StateError.
NOTE: This method is not highly optimized.
Implementation
Card find(CardSet cardSet, int orderInSet) {
final result = tryFind(cardSet, orderInSet);
if (result != null) {
return result;
}
throw StateError('Card not found: $cardSet $orderInSet');
}