예제 #1
0
        private List <Card> Create_52_deck()
        {
            var k = Enumerable.Range(2, Card.GetMaxPictureNumber() - 1).ToList();

            var deck = k.Select(x => new Card(x, (Card.CardColor)((x - 2) % 4))).ToList();

            return(deck);
        }
예제 #2
0
        public static List <Card> Create_52_deck()
        {
            var deck = new List <Card>();

            for (int i = 2; i <= Card.GetMaxPictureNumber(); i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    var card = new Card();
                    card.Number = i;
                    card.Color  = (CardColor)j;
                    deck.Add(card);
                }
            }
            return(deck);
        }