Exemplo n.º 1
0
 private void NewDeck()
 {
     for (int i = 0; i < 52; i++)
     {
         deck[i] = i + 1;
         cards[i] = new Card(i);
     }
 }
Exemplo n.º 2
0
 public bool AllCardsSelected(Card[] karty)
 {
     for (int i = 0; i < karty.Length; i++)
     {
         if (karty[i] == null)
         {
             return false;
         }
     }
     return true;
 }
Exemplo n.º 3
0
        public Card TakeOneCard()
        {
            var m = deck[0];
            var card = new Card(m);
            for (int j = 1; j < 52; j++)
            {
                var r = deck[j];
                deck[j - 1] = r;
                deck[j] = m;
            }

            return card;
        }
Exemplo n.º 4
0
 //public Form2(Deck deck)
 public Form2(Form1 form, int numOfCards, Card[] SelectedCards)
 {
     InitializeComponent();
     this.form = form;
     deck = form.deck;
     if (form.game != null)
     {
         deck = form.game.deck;
     }
     DrawCards();
     cardy = new Card[numOfCards];
     for (int i = 0; i < numOfCards; i++)
     {
         if (SelectedCards[i] != null)
         {
             cardy[i] = SelectedCards[i];
         }
     }
     labels = new Label[] { label1, label2, label3 };
 }
Exemplo n.º 5
0
        public Best_Hand(Card[] karty)
        {
            //int[] numery = new int[5];
            //int[] kolory = new int[5];
            this.Cards = karty;
            for (int i = 0; i < 5; i++)
            {
                numery[i] = Cards[i].Numer;
                kolory[i] = Cards[i].Kolor;
            }
            HandValue();

            //Royal flush	straight from A to 10 and Flush                  10,0,0,0,0,0
            //Straight flush straight and Flush                              9,(lowest card, 0 , 0 , 0 ,0)
            //Four of a kind	4 of the same number                         8,(number of 4 cards, other card, 0 , 0 ,0)
            //Full house	    3 of same number and 2 of other same number  7,(number of 3 cards, number of 2 , 0 , 0 , 0)
            //Flush	            5 of same color                              6,(highest card, Lower , lower, lower, lowest)
            //Straight	        5 kolejnych liczb                            5,(lowest card, 0 , 0 , 0 , 0)
            //Three of a kind	3 of same number                             4,(number of 3 cards, Higher of 2 other, lower of two other, 0 , 0)
            //Two pair	        2 of same number and 2 of other same number  3 (number of higher pair, number of lower pair, 5th card , 0 , 0)
            //One pair          2 of same number                             2,(number of pair, highest of 3 , medium , lowest of 3, 0)
            //No pair	        no pair value of highest card;         value 1, (highest card, Lower , lower, lower, lowest)
        }
Exemplo n.º 6
0
 public Card CopyCard(Card card)
 {
     var newCard = new Card(card.kolor * 13 + (card.numer % 13));
     newCard.canBeUsed = card.CanBeUsed;
     return newCard;
 }
Exemplo n.º 7
0
        public bool IsEmptySlot(Card[] cardy)
        {
            for (int i = 0; i < cardy.Length; i++)
            {
                if (cardy[i] == null)
                {

                    return true;
                }
            }

            return false;
        }