private void GenerateTestCombin(CardSet cards, int [] cardIndexes, int linkValue, int start, int count, int requiredCount, OnTestCombinDelegate onCombin) { if (count == requiredCount) { onCombin(cards, cardIndexes, linkValue); return; } State r = _states[linkValue]; // Go in the order opposite to the order of creation to put a little stress for (int c = start; c <= 52 - (requiredCount - count); ++c) { CardSet newCard = StdDeck.Descriptor.CardSets[c]; int newLinkValue = r.Table[c]; cardIndexes[count] = c; GenerateTestCombin(cards | newCard, cardIndexes, newLinkValue, c + 1, count + 1, requiredCount, onCombin); } }
private void GenerateTestCombin(CardSet handCs, int[] handA, int start, int count, OnTestCombinDelegate onCombin) { if (count == handA.Length) { onCombin(handCs, handA); return; } for (int c = start; c <= 52 - (handA.Length - count); ++c) { CardSet newCard = StdDeck.Descriptor.CardSets[c]; handA[count] = c; GenerateTestCombin(handCs | newCard, handA, c + 1, count + 1, onCombin); } }