Пример #1
0
        /// <summary>
        /// Returns the cards that are left, in order, after removing the same value cards from the original cards.
        /// </summary>
        /// <param name="originalCards">The original cards.</param>
        /// <param name="someOfAKind">The cards that are of the same value.</param>
        /// <returns>The cards that remain after the removal of the provided same value cards.</returns>
        internal static IEnumerable <Card> GetHighCards(IList <Card> originalCards, List <Card> someOfAKind)
        {
            List <Card> clone = new List <Card>();

            clone.AddRange(originalCards);

            HandFamily.RemoveCardValue(clone, someOfAKind[0]);

            Hand bestHighCard    = highCardHelper.GetBestHand(clone);
            int  completionCount = 5 - someOfAKind.Count;

            if (bestHighCard == null)
            {
                Card[] result = new Card[completionCount];
                for (int i = 0; i < result.Length; ++i)
                {
                    result[i] = Card.Empty;
                }
                return(result);
            }
            else
            {
                return(HighCardFamily.GetHighCards(bestHighCard, completionCount));
            }
        }
Пример #2
0
 /// <summary>
 ///     <para>Initializes an instance of the <see cref="Hand"/> class.</para>
 /// </summary>
 /// <param name="family">
 ///		The family that created the current hand.
 /// </param>
 protected Hand(HandFamily family)
 {
     this.creatingFamily = family;
 }