Suppose you have a Enum like this:
public enum CardNumber
{
Two = 2,
Three = 3,
Four = 4,
Five = 5,
Six = 6,
Seven = 7,
Eight = 8,
Nine = 9,
Ten = 10,
Jack = 'J',
Queen = 'Q',
King = 'K',
Ace = 'A',
}
And a loop like:
foreach (Suits suit in Enum.GetValues(typeof(Suits)))
{
deck.Add(new Card()
{
Suits = suit,
CardNumber = num,
image = "~/img/" + suit + num + Enum.GetValues(suit).ToString(),
});
}
How can I get the identifers value? I tried doing the .GetValues() but I get I cannot conver suits to System.Type.
Thanks in advance.
Example I want the values 2, 3,4, 5, etc.