public static void LoadCards()
{
Deck deck = new Deck();
for (int i = 0; i < 24; i++)
{
Random r = new Random();
YourDeck.Add(deck.CardNames[r.Next(0, 14)]);
}
}
Your Random class should not be created in the foreach loop. If you keep initalizing random within the foreach loop when it seeds itself to produce random number you keep starting that sequence over based on time of system clock. If you place it outside the foreach loop it will maintain it's initial seed data and produce numbers without reseeding back to the first one.
So your code would look like this:
public static void LoadCards()
{
//Random initialized outside of the foreach loop
Random r = new Random();
Deck deck = new Deck();
for (int i = 0; i < 24; i++)
{
YourDeck.Add(deck.CardNames[r.Next(0, 14)]);
}
}
Documentation on default constructor for Random.