Permalink
Browse files

Added export of road information to XML

  • Loading branch information...
1 parent 671303a commit d104774369dd9a5f4c49aa5ce3f01a225ead65dc @jterrace jterrace committed Jun 19, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 mapgen2.as
View
@@ -1006,6 +1006,7 @@ package {
var dnodes:Array = [];
var edges:Array = [];
var vnodes:Array = [];
+ var outroads:Array = [];
var accum:Array = []; // temporary accumulator for serialized xml fragments
var edgeNode:XML;
@@ -1069,12 +1070,17 @@ package {
<REPLACE/>
</corner>.toXMLString().replace("<REPLACE/>", accum.join("")));
}
+
+ for (var i:String in roads.road) {
+ outroads.push(<road edge={i} contour={roads.road[i]} />.toXMLString());
+ }
var out:String = top.toXMLString();
accum = [].concat("<centers>",
dnodes, "</centers><edges>",
edges, "</edges><corners>",
- vnodes, "</corners>");
+ vnodes, "</corners><roads>",
+ outroads, "</roads>");
out = out.replace("<REPLACE/>", accum.join(""));
return out;
}

0 comments on commit d104774

Please sign in to comment.