Rename MiniYaml MergeLiberal -> MergePartial, MergeStrict -> Merge.

This commit is contained in:
Paul Chote
2015-05-10 15:45:33 +01:00
committed by Oliver Brakmann
parent abed25d293
commit a074bb1d4b
14 changed files with 21 additions and 21 deletions

View File

@@ -98,7 +98,7 @@ namespace OpenRA
throw new YamlException(
"Bogus inheritance -- duplicate inheritance of {0}.".F(kv.Key));
node = MiniYaml.MergeStrict(node, MergeWithParents(kv.Value, allUnits, allParents));
node = MiniYaml.Merge(node, MergeWithParents(kv.Value, allUnits, allParents));
}
return node;

View File

@@ -101,7 +101,7 @@ namespace OpenRA
var mergedNodes = files
.Select(s => MiniYaml.FromFile(s))
.Aggregate(nodes, MiniYaml.MergeLiberal);
.Aggregate(nodes, MiniYaml.MergePartial);
Func<MiniYamlNode, Dictionary<string, MiniYaml>, T> wrap = (wkv, wyy) =>
{

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Graphics
cachedSheets = new Dictionary<string, Sheet>();
cachedSprites = new Dictionary<string, Dictionary<string, Sprite>>();
var chrome = chromeFiles.Select(s => MiniYaml.FromFile(s)).Aggregate(MiniYaml.MergeLiberal);
var chrome = chromeFiles.Select(s => MiniYaml.FromFile(s)).Aggregate(MiniYaml.MergePartial);
foreach (var c in chrome)
LoadCollection(c.Key, c.Value);

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Graphics
public CursorProvider(ModData modData)
{
var sequenceFiles = modData.Manifest.Cursors;
var sequences = new MiniYaml(null, sequenceFiles.Select(s => MiniYaml.FromFile(s)).Aggregate(MiniYaml.MergeLiberal));
var sequences = new MiniYaml(null, sequenceFiles.Select(s => MiniYaml.FromFile(s)).Aggregate(MiniYaml.MergePartial));
var shadowIndex = new int[] { };
var nodesDict = sequences.ToDictionary();

View File

@@ -129,7 +129,7 @@ namespace OpenRA.Graphics
var nodes = sequenceFiles
.Select(s => MiniYaml.FromFile(s))
.Aggregate(sequenceNodes, MiniYaml.MergeLiberal);
.Aggregate(sequenceNodes, MiniYaml.MergePartial);
var items = new Dictionary<string, UnitSequences>();
foreach (var n in nodes)

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Graphics
var sequences = voxelFiles
.Select(s => MiniYaml.FromFile(s))
.Aggregate(voxelNodes, MiniYaml.MergeLiberal);
.Aggregate(voxelNodes, MiniYaml.MergePartial);
foreach (var s in sequences)
LoadVoxelsForUnit(s.Key, s.Value);

View File

@@ -262,12 +262,12 @@ namespace OpenRA
return FromLines(text.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries), fileName);
}
public static List<MiniYamlNode> MergeStrict(List<MiniYamlNode> a, List<MiniYamlNode> b)
public static List<MiniYamlNode> Merge(List<MiniYamlNode> a, List<MiniYamlNode> b)
{
return Merge(a, b, false);
}
public static List<MiniYamlNode> MergeLiberal(List<MiniYamlNode> a, List<MiniYamlNode> b)
public static List<MiniYamlNode> MergePartial(List<MiniYamlNode> a, List<MiniYamlNode> b)
{
return Merge(a, b, true);
}
@@ -327,12 +327,12 @@ namespace OpenRA
return ret;
}
public static MiniYaml MergeLiberal(MiniYaml a, MiniYaml b)
public static MiniYaml MergePartial(MiniYaml a, MiniYaml b)
{
return Merge(a, b, true);
}
public static MiniYaml MergeStrict(MiniYaml a, MiniYaml b)
public static MiniYaml Merge(MiniYaml a, MiniYaml b)
{
return Merge(a, b, false);
}

View File

@@ -119,10 +119,10 @@ namespace OpenRA
return;
}
var yaml = Manifest.Translations.Select(MiniYaml.FromFile).Aggregate(MiniYaml.MergeLiberal);
var yaml = Manifest.Translations.Select(MiniYaml.FromFile).Aggregate(MiniYaml.MergePartial);
Languages = yaml.Select(t => t.Key).ToArray();
yaml = MiniYaml.MergeLiberal(map.TranslationDefinitions, yaml);
yaml = MiniYaml.MergePartial(map.TranslationDefinitions, yaml);
foreach (var y in yaml)
{

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Widgets
{
data = new Dictionary<string, string>();
var metrics = yaml.Select(y => MiniYaml.FromFile(y))
.Aggregate(MiniYaml.MergeLiberal);
.Aggregate(MiniYaml.MergePartial);
foreach (var m in metrics)
foreach (var n in m.Value.Nodes)