Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3 from jterrace/master

Added export of road information to XML
  • Loading branch information...
commit 726a43adf55dd3efa6cad7a0c80da3fea9204a4f 2 parents 671303a + d104774
@amitp authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 mapgen2.as
View
8 mapgen2.as
@@ -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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.