| 229 | } |
| 230 | |
| 231 | struct TileType |
| 232 | { |
| 233 | df::tiletype_shape shape; |
| 234 | df::tiletype_material material; |
| 235 | df::tiletype_special special; |
| 236 | df::tiletype_variant variant; |
| 237 | int dig; |
| 238 | int hidden; |
| 239 | int light; |
| 240 | int subterranean; |
| 241 | int skyview; |
| 242 | int aquifer; |
| 243 | int autocorrect; |
| 244 | int stone_material; |
| 245 | df::inclusion_type vein_type; |
| 246 | |
| 247 | TileType() |
| 248 | { |
| 249 | clear(); |
| 250 | } |
| 251 | |
| 252 | void clear() |
| 253 | { |
| 254 | shape = tiletype_shape::NONE; |
| 255 | material = tiletype_material::NONE; |
| 256 | special = tiletype_special::NONE; |
| 257 | variant = tiletype_variant::NONE; |
| 258 | dig = -1; |
| 259 | hidden = -1; |
| 260 | light = -1; |
| 261 | subterranean = -1; |
| 262 | skyview = -1; |
| 263 | aquifer = -1; |
| 264 | autocorrect = 0; |
| 265 | stone_material = -1; |
| 266 | vein_type = inclusion_type::CLUSTER; |
| 267 | } |
| 268 | |
| 269 | bool empty() |
| 270 | { |
| 271 | return shape == -1 && material == -1 && special == -1 && variant == -1 |
| 272 | && dig == -1 && hidden == -1 && light == -1 && subterranean == -1 |
| 273 | && skyview == -1 && aquifer == -1 && autocorrect == 0 |
| 274 | && stone_material == -1; |
| 275 | } |
| 276 | |
| 277 | inline bool matches(const df::tiletype source, |
| 278 | const df::tile_designation des, |
| 279 | const df::tile_occupancy occ, |
| 280 | const t_matpair mat) const |
| 281 | { |
| 282 | bool rv = true; |
| 283 | rv &= (shape == -1 || shape == tileShape(source)); |
| 284 | if (stone_material >= 0) |
| 285 | rv &= isStoneMaterial(source) && mat.mat_type == 0 && mat.mat_index == stone_material; |
| 286 | else |
| 287 | rv &= (material == -1 || material == tileMaterial(source)); |
| 288 | rv &= (special == -1 || special == tileSpecial(source)); |
no outgoing calls
no test coverage detected