Have you explored the C# Random Class and its methods ? I'd like to see some code where you use that; right now it looks like you have not really done anything but write some Enums.
Let's see how simple it is to get a List of 52 unique numbers in the range #0~51:
using System.Collections.Generic;
using System.Linq;
private Random rnd;
private List<int> ShuffledDeck;
private void ShuffleButton_Click(object sender, EventArgs e)
{
rnd = new Random(DateTime.Now.Millisecond);
ShuffledDeck = new List<int>(52);
int card;
List<int> DeckSequence = Enumerable.Range(0, 52).ToList();
for (int i = 0; i < 52; i++)
{
card = DeckSequence[rnd.Next(0, DeckSequence.Count)];
DeckSequence.Remove(card);
ShuffledDeck.Add(card);
}
}
We create an ordered list, select a value from it with a random function, remove that selected value from the ordered list; each time we select the ordered list is getting "shorter."
Note: for a discussion of "seeding" the .NET default pseudo-random number generator: [
^]. If you want better "quality" randomness, look into the "System.Security.Cryptography.RandomNumberGenerator" facility in .NET.
Enums: note that while having Enum entries with the same assigned value is "legal" in .NET, you should
at least think about the issues discussed here: [
^].