I have a program that uses hardcoded tables. For instance.
public static readonly IDictionary<SpecBuild, BuildInfo> Builds = new Dictionary<SpecBuild, BuildInfo> {
{ SpecBuild.WarriorArms,
new BuildInfo {
Class = Class.Warrior,
Name = "Arms",
Role = Role.Melee
}
},
{ SpecBuild.WarriorFury,
new BuildInfo {
Class = Class.Warrior,
Name = "Fury",
Role = Role.Melee
}
},
{ SpecBuild.WarriorProtection,
new BuildInfo {
Class = Class.Warrior,
Name = "Protection",
Role = Role.Tank
}
}, ...
This data rarely changes, so I'm fine-tuned. The problem is that reading this data is difficult, and formatting does not work, because Resharper reformatts it differently.
Ideally, I would like to get a special format file with a custom VS2010 representation that would represent this information in a table and generate C # code for this table as part of the compilation process, or perhaps even compile it directly into MSIL (CLR).
I am looking for a turnkey solution, the problem is not so serious as to guarantee additional development.
source
share