Belot.CardsCollection.Add C# (CSharp) Метод

Add() приватный Метод

private Add ( Card value ) : int
value Card
Результат int
        internal virtual int Add( Card value )
        {
            int ret =  InnerList.Add( value );
            RaiseChanged();
            return ret;
        }

Usage Example

Пример #1
0
        private void FindSequentialForColor(CardsCollection cards)
        {
            CardComparer comparer = new CardComparer( );

            cards.Sort(comparer);               // we have cards sorted like A,K,Q,J,10,9,8,7

            CardsCollection foundCards = new CardsCollection();

            for (int i = 0; i < cards.Count - 1; i++)
            {
                if (IsConsequent(cards[i], cards[i + 1]))
                {
                    if (foundCards.IsEmpty)
                    {
                        foundCards.Add(cards[i]);
                    }

                    foundCards.Add(cards[i + 1]);
                }
                else
                {
                    if (!foundCards.IsEmpty)
                    {
                        AddSequentialCombination(foundCards);
                        foundCards = new CardsCollection();
                    }
                }
            }

            if (!foundCards.IsEmpty)
            {
                AddSequentialCombination(foundCards);
            }
        }
All Usage Examples Of Belot.CardsCollection::Add