file-format: writeMap() use tags to indicate where new rows start

This commit is contained in:
Jason Long 2013-07-27 16:43:05 -04:00
parent a3d2c1f441
commit 69bf269655

View file

@ -2053,9 +2053,10 @@ public class Micropolis
throws XMLStreamException
{
out.writeStartElement("map");
for (int x = 0; x < DEFAULT_WIDTH; x++)
for (int y = 0; y < DEFAULT_HEIGHT; y++)
{
for (int y = 0; y < DEFAULT_HEIGHT; y++)
out.writeStartElement("mapRow");
for (int x = 0; x < DEFAULT_WIDTH; x++)
{
int z = map[y][x];
if (isConductive(z & LOMASK)) {
@ -2073,13 +2074,14 @@ public class Micropolis
if (isZoneCenter(z & LOMASK)) {
z |= 1024; //synthesize ZONEBIT
}
if (!(x==0 && y==0)) {
out.writeCharacters(",");
if (x != 0) {
out.writeCharacters(" ");
}
out.writeCharacters(Integer.toString(z));
}
out.writeEndElement(); //mapRow
}
out.writeEndElement();
out.writeEndElement(); //map
}
public void load(File filename)