static CardRank() { CardRank.Two = new CardRank(2, "2"); CardRank.Three = new CardRank(3, "3"); CardRank.Four = new CardRank(4, "4"); CardRank.Five = new CardRank(5, "5"); CardRank.Six = new CardRank(6, "6"); CardRank.Seven = new CardRank(7, "7"); CardRank.Eight = new CardRank(8, "8"); CardRank.Nine = new CardRank(9, "9"); CardRank.Ten = new CardRank(10, "10"); CardRank.Jack = new CardRank(10, "J"); CardRank.Queen = new CardRank(10, "Q"); CardRank.King = new CardRank(10, "K"); CardRank.Ace = new CardRank(11, "A"); CardRank[] all = new CardRank[13]; // holds all ranks all[0] = CardRank.Two; all[1] = CardRank.Three; all[2] = CardRank.Four; all[3] = CardRank.Five; all[4] = CardRank.Six; all[5] = CardRank.Seven; all[6] = CardRank.Eight; all[7] = CardRank.Nine; all[8] = CardRank.Ten; all[9] = CardRank.Jack; all[10] = CardRank.Queen; all[11] = CardRank.King; all[12] = CardRank.Ace; CardRank.Ranks = all; }
public Card(CardRank rank, CardSuit suit) // main constructor for card { this.rank = rank; this.suit = suit; }
private CardRank rank; //am modificat din tipul initial (string) in Enum de CardRank public Card(CardRank CardRank, CardSuit CardSuit) { suit = CardSuit; rank = CardRank; }