Changed: Made it possible for maps to contain custom sequences (allowing 100% custom map-specific units to be 'build')

This commit is contained in:
geckosoft
2010-11-15 02:08:27 +01:00
committed by Chris Forbes
parent 414b3a03c3
commit b31a35d34b
3 changed files with 16 additions and 8 deletions

View File

@@ -21,15 +21,13 @@ namespace OpenRA.Graphics
{
static Dictionary<string, Dictionary<string, Sequence>> units;
public static void Initialize(string[] sequenceFiles)
public static void Initialize(string[] sequenceFiles, List<MiniYamlNode> sequenceNodes)
{
units = new Dictionary<string, Dictionary<string, Sequence>>();
if (sequenceFiles.Length == 0)
return;
var sequences = sequenceFiles
.Select(s => MiniYaml.FromFile(s))
.Aggregate(MiniYaml.Merge);
var sequences = sequenceFiles.Select(s => MiniYaml.FromFile(s)).Aggregate(sequenceNodes, MiniYaml.Merge);
foreach (var s in sequences)
LoadSequencesForUnit(s.Key, s.Value);