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 class ActorReference
{ {
public readonly string Id; public string Id { get; private set; }
public readonly string Type; public readonly string Type;
public readonly int2 Location; public readonly int2 Location;
public readonly string Owner; public readonly string Owner;
public ActorReference(MiniYaml my) public ActorReference( string id, MiniYaml my)
{ {
Id = id;
FieldLoader.Load(this, my); FieldLoader.Load(this, my);
} }

View File

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

View File

@@ -27,83 +27,67 @@ Players:
NonCombatant: True NonCombatant: True
Actors: Actors:
ActorReference@Actor0: Actor0:
Id: Actor0
Type: mine Type: mine
Location: 23,107 Location: 23,107
Owner: Neutral Owner: Neutral
ActorReference@Actor1: Actor1:
Id: Actor1
Type: mine Type: mine
Location: 20,105 Location: 20,105
Owner: Neutral Owner: Neutral
ActorReference@Actor4: Actor4:
Id: Actor4
Type: mine Type: mine
Location: 23,20 Location: 23,20
Owner: Neutral Owner: Neutral
ActorReference@Actor3: Actor3:
Id: Actor3
Type: mine Type: mine
Location: 20,23 Location: 20,23
Owner: Neutral Owner: Neutral
ActorReference@Actor5: Actor5:
Id: Actor5
Type: mine Type: mine
Location: 104,19 Location: 104,19
Owner: Neutral Owner: Neutral
ActorReference@Actor6: Actor6:
Id: Actor6
Type: mine Type: mine
Location: 108,22 Location: 108,22
Owner: Neutral Owner: Neutral
ActorReference@Actor7: Actor7:
Id: Actor7
Type: mine Type: mine
Location: 105,108 Location: 105,108
Owner: Neutral Owner: Neutral
ActorReference@Actor8: Actor8:
Id: Actor8
Type: mine Type: mine
Location: 108,105 Location: 108,105
Owner: Neutral Owner: Neutral
ActorReference@Actor2: Actor2:
Id: Actor2
Type: mine Type: mine
Location: 71,109 Location: 71,109
Owner: Neutral Owner: Neutral
ActorReference@Actor9: Actor9:
Id: Actor9
Type: mine Type: mine
Location: 75,109 Location: 75,109
Owner: Neutral Owner: Neutral
ActorReference@Actor10: Actor10:
Id: Actor10
Type: mine Type: mine
Location: 109,47 Location: 109,47
Owner: Neutral Owner: Neutral
ActorReference@Actor11: Actor11:
Id: Actor11
Type: mine Type: mine
Location: 109,44 Location: 109,44
Owner: Neutral Owner: Neutral
ActorReference@Actor12: Actor12:
Id: Actor12
Type: mine Type: mine
Location: 53,18 Location: 53,18
Owner: Neutral Owner: Neutral
ActorReference@Actor13: Actor13:
Id: Actor13
Type: mine Type: mine
Location: 49,18 Location: 49,18
Owner: Neutral Owner: Neutral
ActorReference@Actor14: Actor14:
Id: Actor14
Type: mine Type: mine
Location: 18,80 Location: 18,80
Owner: Neutral Owner: Neutral
ActorReference@Actor15: Actor15:
Id: Actor15
Type: mine Type: mine
Location: 18,75 Location: 18,75
Owner: Neutral Owner: Neutral

File diff suppressed because it is too large Load Diff