tiles: transfer ZONEBIT knowledge to tiles.rc

and synthesize ZONEBIT when saving (for compatibility)

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@740 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-07-20 21:10:29 +00:00
parent 9bf2e91783
commit 91b3736886
8 changed files with 83 additions and 70 deletions

View file

@ -6,6 +6,8 @@ public class TileSpec
{
int tileNumber;
TileSpec animNext;
boolean zone;
Map<String,String> attributes;
List<String> images;
@ -28,6 +30,12 @@ public class TileSpec
return attributes.get(key);
}
public boolean getBooleanAttribute(String key)
{
String v = getAttribute(key);
return (v != null && v.equals("true"));
}
public String [] getImages()
{
return images.toArray(new String[0]);
@ -42,7 +50,7 @@ public class TileSpec
if (in.peekChar() == '(') {
in.eatChar('(');
String k = in.readAttributeKey();
String v = "1";
String v = "true";
if (in.peekChar() == '=') {
in.eatChar('=');
v = in.readAttributeValue();
@ -60,6 +68,8 @@ public class TileSpec
images.add(v);
}
}
this.zone = getBooleanAttribute("zone");
}
static class Scanner