Example #1
0
        public Card(Enums.Card_Enums.CardRank rank, Enums.Card_Enums.CardSuit suit)
        {
            this.Rank = rank;
            this.Suit = suit;

            DefineCost();
        }
Example #2
0
        private void SetAllCards(Deck deck)
        {
            var suits = Enum.GetValues(typeof(Enums.Card_Enums.CardSuit));
            var ranks = Enum.GetValues(typeof(Enums.Card_Enums.CardRank));

            for (int i = 0; i < suits.Length; i++)
            {
                for (int j = 0; j < ranks.Length; ++j)
                {
                    Enums.Card_Enums.CardSuit suit = (Enums.Card_Enums.CardSuit)suits.GetValue(i);
                    Enums.Card_Enums.CardRank rank = (Enums.Card_Enums.CardRank)ranks.GetValue(j);

                    Card card;
                    if (rank == Enums.Card_Enums.CardRank.Ace)
                    {
                        card = new Ace(rank, suit);
                    }
                    else
                    {
                        card = new Card(rank, suit);
                    }

                    deck.Cards.Add(card);
                }
            }
        }
Example #3
0
 public Ace(Enums.Card_Enums.CardRank rank, Enums.Card_Enums.CardSuit suit) : base(rank, suit)
 {
 }