public Card(suit s, value v, CardWindow c) { InitializeComponent(); _suit = s; _value = v; _faceShowing = false; Width = _sizeX; Height = _sizeY; cardBorder.CornerRadius = new CornerRadius(_sizeX / 10); _myCanvas = c; }
public Deck() { name car = name.Six; int card_caunt = 0; for (int i = 0; i < 9; i++) { Card c; suit suit = suit.Heart; for (int j = 0; j < 4; j++) { c = new Card(car, suit); card_deck[card_caunt++] = c; suit++; } car++; } }
/* * Generates a standard 52 card deck. */ protected void GenerateCards() { // Keeps track of how many duplicates need to be made. int dupIter = 0; int faceValue = 1; for (int i = 0; i < 52; i++) { // Increment face value when duplicates for that value have been created. if (dupIter > 3) { faceValue++; dupIter = 0; } suit currentSuit = (suit)(i % 4); Card nextCard = new Card(currentSuit, faceValue); this.Cards.Push(nextCard); dupIter++; } }
private suit getsuit(int card) { suit s = new suit(); int d; if (card - 1 < 0) { d = 0; } else { d = (card - 1) / 13; } switch (d) { case 0: s = suit.SUIT_HEART; break; case 1: s = suit.SUIT_DIA; break; case 2: s = suit.SUIT_SPADE; break; case 3: s = suit.SUIT_CLOVER; break; case 4: s = suit.SUIT_JOKER; break; default: break; } return(s); }
public void Club() { Suit = suit.club; }
public void setCardSuit(suit cardSuit) { this.cardSuit = cardSuit; }
public Card(rank Rank, suit Suit) { this.Rank = Rank; this.Suit = Suit; }
public card(int c, suit s) { }
public Deck(suit cs, rank cv) : base(cs, cv) { }
//constructor sets the card suit and number to what is passed in public Card(int suit, int number) { this.suit = (suit)suit; this.numbers = (numbers)number; }
//konstruktor public Card(value cardValue, suit cardSuit) { this.cardValue = cardValue; this.cardSuit = cardSuit; }
public void Diamond() { Suit = suit.diamond; }
public void Spade() { Suit = suit.spade; }
public void Heart() { Suit = suit.heart; }
public Card(name name, suit suit) { Name = name; Suit = suit; }
//constructor public Card(suit cs, rank cv) { cardShape = cs; cardValue = cv; }
public Card(int v, suit s) { this.s = s; this.value = v; }
public Card(rank r, suit s) { Rank = r; Suit = s; IsFaceDown = true; }
public Card(suit suit, int faceValue) { this.Suit = suit; this.FaceValue = faceValue; }