change map format to remove redundant crap
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user