change map format to remove redundant crap

This commit is contained in:
Bob
2010-07-31 16:34:02 +12:00
parent 74155812d0
commit bceaecf031
4 changed files with 416 additions and 820 deletions

View File

@@ -12,13 +12,14 @@ namespace OpenRA.FileFormats
{
public class ActorReference
{
public readonly string Id;
public string Id { get; private set; }
public readonly string Type;
public readonly int2 Location;
public readonly string Owner;
public ActorReference(MiniYaml my)
public ActorReference( string id, MiniYaml my)
{
Id = id;
FieldLoader.Load(this, my);
}

View File

@@ -132,7 +132,7 @@ namespace OpenRA.FileFormats
{
foreach (var kv in yaml["Actors"].Nodes)
{
var a = new ActorReference(kv.Value);
var a = new ActorReference(kv.Key, kv.Value);
Actors.Add(a.Id, a);
}
}
@@ -172,7 +172,7 @@ namespace OpenRA.FileFormats
root.Add("Actors",
new MiniYaml(null, Actors.ToDictionary(
a => "ActorReference@{0}".F(a.Key),
a => "{0}".F(a.Key),
a => FieldSaver.Save(a.Value))));
root.Add("Waypoints", MiniYaml.FromDictionary<string, int2>(Waypoints));