예제 #1
0
        public void GetCards(Stack <Karta> kartas)
        {
            int size = kartas.Count + koloda.Count;

            Karta[] templ = new Karta[size];
            kartas.CopyTo(templ, 0);
            koloda.CopyTo(templ, kartas.Count);
            koloda = new Stack <Karta>(templ);
        }
예제 #2
0
        private void CreateKoloda()
        {
            int counter = 0;

            while (true)
            {
                if (counter == 36)
                {
                    break;
                }
                Karta karta = new Karta((Mast)rnd.Next(1, 5), (Rang)rnd.Next(6, 15));
                if (Koloda.Any(k => k.mast == karta.mast && k.rang == karta.rang))
                {
                    continue;
                }
                else
                {
                    Koloda.Add(karta);
                    counter++;
                }
            }
        }