Пример #1
0
        public void Shuffle()
        {
            Random rng = new Random();

            for (int i = 0; i < 5; ++i)
            {
                for (int j = 0; j < cards.Count; ++j)
                {
                    int  swapIndex = rng.Next(cards.Count);
                    Card temp      = cards[j];
                    cards[j]         = cards[swapIndex];
                    cards[swapIndex] = temp;
                }
            }

            Shuffled?.Invoke(this, EventArgs.Empty);
        }
Пример #2
0
 public async Task Shuffle()
 {
     Thread.Sleep(500);
     PokerService.Instance.Shuffle();
     await Shuffled?.Invoke(this);
 }