Exemplo n.º 1
0
        public void ShuffleCards()
        {
            if (CounterForShuffle == 0)
            {
                CounterForShuffle++;
                SubPrimaryDeck = new List <int>
                {
                    1, 2, 3, 4, 5, 6, 7, 8,
                    9, 10, 11, 12, 13, 14, 15,
                    16, 17, 18, 19, 20, 21, 22,
                    23, 24, 25, 26, 27, 28, 29,
                    30, 31, 32, 33, 34, 35, 36,
                    37, 38, 39, 40, 41, 42, 43,
                    44, 45, 46, 47, 48, 49, 50,
                    51, 52
                };
            }
            else
            {
                MainDeck.ForEach(p => SubPrimaryDeck.Add(p));
                MainDeck.Clear();
                SubMediumDeck.Clear();
            }



            while (SubPrimaryDeck.Count != 0)
            {
                Picker    = RdmPicker.Next(0, SubPrimaryDeck.Count);
                OneBefore = Picker - 1;
                OneAfter  = Picker + 1;

                if (OneBefore >= 0)
                {
                    SubMediumDeck.Add(SubPrimaryDeck[OneBefore]);
                    SubPrimaryDeck.RemoveAt(OneBefore);
                }
                else
                {
                    SinglePicker();
                }

                if (OneAfter < SubPrimaryDeck.Count)
                {
                    SubMediumDeck.Add(SubPrimaryDeck[OneAfter]);
                    SubPrimaryDeck.RemoveAt(OneAfter);
                }
                else
                {
                    SinglePicker();
                }

                ShuffleAgain();
            }
            Console.WriteLine($"**** Shuffled *******");
        }
Exemplo n.º 2
0
 private void ShuffleAgain()
 {
     while (SubMediumDeck.Count != 0)
     {
         Picker = RdmPicker.Next(0, SubMediumDeck.Count);
         if (Picker < SubMediumDeck.Count)
         {
             MainDeck.Add(SubMediumDeck[Picker]);
             SubMediumDeck.RemoveAt(Picker);
         }
     }
 }