Ejemplo n.º 1
0
        private Card GetCardById(long id)
        {
            Tuple <Suit, Rank> cardData = CardHelper.GetCardById(id);
            Card card = new Card {
                Id = id, Suit = cardData.Item1, Rank = cardData.Item2
            };

            return(card);
        }
Ejemplo n.º 2
0
        private Card[] GenerateCards()
        {
            var now = DateTime.Now;

            Card[] cards = Enumerable.Range(1, Constants.CardCount)
                           .Select(i =>
            {
                Tuple <Suit, Rank> cardData = CardHelper.GetCardById(i);
                var card = new Card {
                    Id = i, CreationTime = now, Suit = cardData.Item1, Rank = cardData.Item2
                };
                return(card);
            })
                           .ToArray();
            return(cards);
        }