make yaml into a list, rather than a dict

This commit is contained in:
Bob
2010-08-26 21:59:43 +12:00
committed by Chris Forbes
parent bce52e989f
commit 2f92b873e8
15 changed files with 176 additions and 141 deletions

View File

@@ -22,7 +22,7 @@ namespace OpenRA.GameRules
public readonly string DefaultVariant = ".aud" ;
public readonly string[] DisableVariants = { };
Func<MiniYaml, string, Dictionary<string, string[]>> Load = (y,name) => (y.Nodes.ContainsKey(name))? y.Nodes[name].Nodes.ToDictionary(a => a.Key,
Func<MiniYaml, string, Dictionary<string, string[]>> Load = (y,name) => (y.NodesDict.ContainsKey(name))? y.NodesDict[name].NodesDict.ToDictionary(a => a.Key,
a => (string[])FieldLoader.GetValue( "(value)", typeof(string[]), a.Value.Value ))
: new Dictionary<string, string[]>();
@@ -30,7 +30,7 @@ namespace OpenRA.GameRules
public VoiceInfo( MiniYaml y )
{
FieldLoader.LoadFields(this, y.Nodes, new string[] { "DisableVariants" });
FieldLoader.LoadFields(this, y.NodesDict, new string[] { "DisableVariants" });
Variants = Load(y, "Variants");
Voices = Load(y, "Voices");