This commit is contained in:
Paul Chote
2010-05-24 21:29:16 +12:00
parent 7ef2ed1434
commit f5b313b5e8
4 changed files with 207 additions and 90 deletions

View File

@@ -35,7 +35,7 @@ namespace OpenRA.FileFormats
// Yaml map data // Yaml map data
public bool Selectable = true; public bool Selectable = true;
public int MapFormat = 1; public int MapFormat;
public string Title; public string Title;
public string Description; public string Description;
public string Author; public string Author;
@@ -117,7 +117,7 @@ namespace OpenRA.FileFormats
} }
// Players // Players
if (MapFormat < 2) if (MapFormat == 1)
{ {
Players.Add("Neutral", new PlayerReference("Neutral", "neutral", "allies", true, true)); Players.Add("Neutral", new PlayerReference("Neutral", "neutral", "allies", true, true));
} }
@@ -131,7 +131,7 @@ namespace OpenRA.FileFormats
} }
// Actors // Actors
if (MapFormat == 1 ) if (MapFormat == 1)
{ {
int actors = 0; int actors = 0;
foreach (var kv in yaml["Actors"].Nodes) foreach (var kv in yaml["Actors"].Nodes)
@@ -142,23 +142,12 @@ namespace OpenRA.FileFormats
Actors.Add(a.Id, a); Actors.Add(a.Id, a);
} }
} }
else if (MapFormat == 2)
{
int actors = 0;
foreach (var kv in yaml["Actors"].Nodes)
{
string[] vals = kv.Value.Value.Split(' ');
string[] loc = vals[2].Split(',');
var a = new ActorReference("Actor"+actors++, vals[0], new int2(int.Parse(loc[0]), int.Parse(loc[1])), vals[1]);
Actors.Add(kv.Key, a);
}
}
else else
{ {
foreach (var kv in yaml["Actors"].Nodes) foreach (var kv in yaml["Actors"].Nodes)
{ {
var player = new ActorReference(kv.Value); var a = new ActorReference(kv.Value);
Actors.Add(player.Id, player); Actors.Add(a.Id, a);
} }
} }
@@ -179,7 +168,7 @@ namespace OpenRA.FileFormats
public void Save(string filepath) public void Save(string filepath)
{ {
MapFormat = 3; MapFormat = 2;
Dictionary<string, MiniYaml> root = new Dictionary<string, MiniYaml>(); Dictionary<string, MiniYaml> root = new Dictionary<string, MiniYaml>();
foreach (var field in SimpleFields) foreach (var field in SimpleFields)

View File

@@ -1,6 +1,6 @@
Selectable: False Selectable: False
MapFormat: 3 MapFormat: 2
Title: <none> Title: <none>

View File

@@ -1 +1 @@
eb86567c36a51a6a0c4402932c3d4147307e6232 c3a9e0b14a9bf72b98b739f1f415f84db934a1d0

View File

@@ -1,71 +1,199 @@
Selectable: True Selectable: True
MapFormat: 2 MapFormat: 2
Title: Snowy Ridge Title: Snowy Ridge
Description: Free-for-all deathmatch in the snow Description: Free-for-all deathmatch in the snow
Author: Chris Forbes Author: Chris Forbes
PlayerCount: 3 PlayerCount: 3
Tileset: SNOW Tileset: SNOW
MapSize: 72,72 MapSize: 72,72
TopLeft: 14,19 TopLeft: 14,19
BottomRight: 60,60 BottomRight: 60,60
Players: Players:
PlayerReference@Neutral: PlayerReference@Neutral:
Name: Neutral Name: Neutral
Palette: neutral Palette: neutral
Race: allies Race: allies
OwnsWorld:true OwnsWorld: True
NonCombatant:true NonCombatant: True
Actors: Actors:
Actor0: tc02 Neutral 25,39 ActorReference@Actor0:
Actor1: tc01 Neutral 26,40 Id: Actor0
Actor2: tc01 Neutral 27,39 Type: tc02
Actor3: tc05 Neutral 30,40 Location: 25,39
Actor4: tc04 Neutral 37,39 Owner: Neutral
Actor5: tc04 Neutral 39,37 ActorReference@Actor1:
Actor6: tc04 Neutral 41,35 Id: Actor1
Actor7: t01 Neutral 42,33 Type: tc01
Actor8: t01 Neutral 50,24 Location: 26,40
Actor9: t05 Neutral 49,25 Owner: Neutral
Actor10: t08 Neutral 45,29 ActorReference@Actor2:
Actor11: tc04 Neutral 43,49 Id: Actor2
Actor12: tc01 Neutral 45,51 Type: tc01
Actor13: tc01 Neutral 48,52 Location: 27,39
Actor14: t03 Neutral 40,42 Owner: Neutral
Actor15: t03 Neutral 35,40 ActorReference@Actor3:
Actor16: tc04 Neutral 57,57 Id: Actor3
Actor17: tc02 Neutral 58,19 Type: tc05
Actor18: tc01 Neutral 21,19 Location: 30,40
Actor19: tc02 Neutral 19,20 Owner: Neutral
Actor20: t08 Neutral 16,22 ActorReference@Actor4:
Actor21: v12 Neutral 18,22 Id: Actor4
Actor22: t05 Neutral 18,55 Type: tc04
Actor23: tc02 Neutral 16,54 Location: 37,39
Actor24: t16 Neutral 29,39 Owner: Neutral
Actor25: t16 Neutral 21,56 ActorReference@Actor5:
Actor26: mine Neutral 33,45 Id: Actor5
Actor27: mine Neutral 36,45 Type: tc04
Actor28: mine Neutral 44,43 Location: 39,37
Actor29: mine Neutral 45,40 Owner: Neutral
Actor30: mine Neutral 37,34 ActorReference@Actor6:
Actor31: mine Neutral 35,37 Id: Actor6
Type: tc04
Waypoints: Location: 41,35
wp0: 29,24 Owner: Neutral
wp1: 56,41 ActorReference@Actor7:
wp2: 26,54 Id: Actor7
Type: t01
Smudges: Location: 42,33
Owner: Neutral
Rules: ActorReference@Actor8:
Id: Actor8
Type: t01
Location: 50,24
Owner: Neutral
ActorReference@Actor9:
Id: Actor9
Type: t05
Location: 49,25
Owner: Neutral
ActorReference@Actor10:
Id: Actor10
Type: t08
Location: 45,29
Owner: Neutral
ActorReference@Actor11:
Id: Actor11
Type: tc04
Location: 43,49
Owner: Neutral
ActorReference@Actor12:
Id: Actor12
Type: tc01
Location: 45,51
Owner: Neutral
ActorReference@Actor13:
Id: Actor13
Type: tc01
Location: 48,52
Owner: Neutral
ActorReference@Actor14:
Id: Actor14
Type: t03
Location: 40,42
Owner: Neutral
ActorReference@Actor15:
Id: Actor15
Type: t03
Location: 35,40
Owner: Neutral
ActorReference@Actor16:
Id: Actor16
Type: tc04
Location: 57,57
Owner: Neutral
ActorReference@Actor17:
Id: Actor17
Type: tc02
Location: 58,19
Owner: Neutral
ActorReference@Actor18:
Id: Actor18
Type: tc01
Location: 21,19
Owner: Neutral
ActorReference@Actor19:
Id: Actor19
Type: tc02
Location: 19,20
Owner: Neutral
ActorReference@Actor20:
Id: Actor20
Type: t08
Location: 16,22
Owner: Neutral
ActorReference@Actor21:
Id: Actor21
Type: v12
Location: 18,22
Owner: Neutral
ActorReference@Actor22:
Id: Actor22
Type: t05
Location: 18,55
Owner: Neutral
ActorReference@Actor23:
Id: Actor23
Type: tc02
Location: 16,54
Owner: Neutral
ActorReference@Actor24:
Id: Actor24
Type: t16
Location: 29,39
Owner: Neutral
ActorReference@Actor25:
Id: Actor25
Type: t16
Location: 21,56
Owner: Neutral
ActorReference@Actor26:
Id: Actor26
Type: mine
Location: 33,45
Owner: Neutral
ActorReference@Actor27:
Id: Actor27
Type: mine
Location: 36,45
Owner: Neutral
ActorReference@Actor28:
Id: Actor28
Type: mine
Location: 44,43
Owner: Neutral
ActorReference@Actor29:
Id: Actor29
Type: mine
Location: 45,40
Owner: Neutral
ActorReference@Actor30:
Id: Actor30
Type: mine
Location: 37,34
Owner: Neutral
ActorReference@Actor31:
Id: Actor31
Type: mine
Location: 35,37
Owner: Neutral
Waypoints:
wp0: 29,24
wp1: 56,41
wp2: 26,54
Smudges:
Rules: