Clear() private méthode

private Clear ( ) : void
Résultat void
        private void FindSequential()
        {
            CardsCollection foundCards = new CardsCollection();

            #region Spades

            foreach( Card card in _cards )
            {
                if( card.CardColor == CardColor.Spades )
                {
                    foundCards.Add( card );
                }
            }

            if( foundCards.Count > 2 )
            {
                FindSequentialForColor( foundCards );
            }

            #endregion

            #region Hearts

            foundCards.Clear( );
            foreach( Card card in _cards )
            {
                if( card.CardColor == CardColor.Hearts )
                {
                    foundCards.Add( card );
                }
            }

            if( foundCards.Count > 2 )
            {
                FindSequentialForColor( foundCards );
            }

            #endregion

            #region Diamonds

            foundCards.Clear( );
            foreach( Card card in _cards )
            {
                if( card.CardColor == CardColor.Diamonds )
                {
                    foundCards.Add( card );
                }
            }

            if( foundCards.Count > 2 )
            {
                FindSequentialForColor( foundCards );
            }

            #endregion

            #region Clubs

            foundCards.Clear( );
            foreach( Card card in _cards )
            {
                if( card.CardColor == CardColor.Clubs )
                {
                    foundCards.Add( card );
                }
            }

            if( foundCards.Count > 2 )
            {
                FindSequentialForColor( foundCards );
            }

            #endregion
        }
Exemple #2
0
        private void FindSequential()
        {
            CardsCollection foundCards = new CardsCollection();

            #region Spades

            foreach (Card card in _cards)
            {
                if (card.CardColor == CardColor.Spades)
                {
                    foundCards.Add(card);
                }
            }

            if (foundCards.Count > 2)
            {
                FindSequentialForColor(foundCards);
            }

            #endregion

            #region Hearts

            foundCards.Clear( );
            foreach (Card card in _cards)
            {
                if (card.CardColor == CardColor.Hearts)
                {
                    foundCards.Add(card);
                }
            }

            if (foundCards.Count > 2)
            {
                FindSequentialForColor(foundCards);
            }

            #endregion

            #region Diamonds

            foundCards.Clear( );
            foreach (Card card in _cards)
            {
                if (card.CardColor == CardColor.Diamonds)
                {
                    foundCards.Add(card);
                }
            }

            if (foundCards.Count > 2)
            {
                FindSequentialForColor(foundCards);
            }

            #endregion

            #region Clubs

            foundCards.Clear( );
            foreach (Card card in _cards)
            {
                if (card.CardColor == CardColor.Clubs)
                {
                    foundCards.Add(card);
                }
            }

            if (foundCards.Count > 2)
            {
                FindSequentialForColor(foundCards);
            }

            #endregion
        }