(String inStr, Properties tilesRc)
| 151 | } |
| 152 | |
| 153 | protected void load(String inStr, Properties tilesRc) |
| 154 | { |
| 155 | Scanner in = new Scanner(inStr); |
| 156 | |
| 157 | while (in.hasMore()) { |
| 158 | |
| 159 | if (in.peekChar() == '(') { |
| 160 | in.eatChar('('); |
| 161 | String k = in.readAttributeKey(); |
| 162 | String v = "true"; |
| 163 | if (in.peekChar() == '=') { |
| 164 | in.eatChar('='); |
| 165 | v = in.readAttributeValue(); |
| 166 | } |
| 167 | in.eatChar(')'); |
| 168 | |
| 169 | if (!attributes.containsKey(k)) { |
| 170 | attributes.put(k, v); |
| 171 | String sup = tilesRc.getProperty(k); |
| 172 | if (sup != null) { |
| 173 | load(sup, tilesRc); |
| 174 | } |
| 175 | } |
| 176 | else { |
| 177 | attributes.put(k, v); |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | else if (in.peekChar() == '|' || in.peekChar() == ',') { |
| 182 | in.eatChar(in.peekChar()); |
| 183 | } |
| 184 | |
| 185 | else { |
| 186 | String v = in.readImageSpec(); |
| 187 | images.add(v); |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | this.canBulldoze = getBooleanAttribute("bulldozable"); |
| 192 | this.canBurn = !getBooleanAttribute("noburn"); |
| 193 | this.canConduct = getBooleanAttribute("conducts"); |
| 194 | this.overWater = getBooleanAttribute("overwater"); |
| 195 | this.zone = getBooleanAttribute("zone"); |
| 196 | } |
| 197 | |
| 198 | static class Scanner |
| 199 | { |
no test coverage detected