Example #1
0
 public static int TimesXOfKind(this IHand hand, int x)
 {
     return hand.CardsByFace().Where(g => g.Count() == x).Count();
 }
Example #2
0
 public static bool HasXOfKind(this IHand hand, int x)
 {
     return hand.CardsByFace().Any(g => g.Count() == x);
 }
Example #3
0
 public static bool IsFaceRepeated(this IHand hand, int times)
 {
     return hand.CardsByFace().Any(g => g.Count() == times);
 }
Example #4
0
 public static IEnumerable<IGrouping<CardFace, ICard>> GetXOfKind(this IHand hand, int x)
 {
     return hand.CardsByFace().Where(g => g.Count() == x);
 }