Reputation: 29
When I try the code below, I get a message that "the name C does not exist in the current context." What am I missing here? I would like the position part in the dictionary to behave just like the other variables, but I've been having trouble using the enum. Thanks!
class stats
{
enum pos { fiB, seB, SS, thB, LF, CF, RF, C, DH, SP, RP };
public double age {get; set;}
public pos position{get; set;}
public double ovalue{get; set;}
public double dvalue{get; set;}
}
public partial class playerdictionary:stats
{
public playerdictionary()
{
var dict = new Dictionary<string, stats>();
dict.Add("AG", new stats { age = 24, position=C, ovalue = 0, dvalue = 4.2 });
}
Upvotes: 0
Views: 130