public List <SheepCard> RetireTwoFailSuitsWithOneAceOrTen() { if (_acesAndTens.Count != 1) { return(null); } var pointSuit = _acesAndTensPerSuit.Single(g => g.Key != Suit.TRUMP).Key; var oneCardSuits = CardsPerSuit .Where(cps => cps.Value == 1) .OrderBy(cps => cps.Key == pointSuit ? 1 : 2) .Select(cps => cps.Key) .Take(2) .ToList(); var buryCards = _cards.Where(c => oneCardSuits.Contains(CardUtil.GetSuit(c))).ToList(); if (buryCards.Count != 2) { return(null); } if (!buryCards.Contains(_acesAndTens.Single())) { return(null); } return(buryCards); }
public List <SheepCard> RetireOneFailSuitsWithOneAceOrTen() { if (_acesAndTens.Count != 1) { return(null); } var pointSuit = _acesAndTensPerSuit.Single(g => g.Key != Suit.TRUMP).Key; var twoCardSuit = CardsPerSuit .Where(cps => cps.Value == 2) .Where(cps => cps.Key == pointSuit) .Select(cps => cps.Key) .FirstOrDefault(); var buryCards = _cards.Where(c => CardUtil.GetSuit(c) == twoCardSuit).ToList(); if (buryCards.Count != 2) { return(null); } if (!buryCards.Contains(_acesAndTens.Single())) { return(null); } return(buryCards); }