MCPcopy Create free account
hub / github.com/DFHack/dfhack / matches

Method matches

plugins/tiletypes.cpp:277–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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));
289 rv &= (variant == -1 || variant == tileVariant(source));
290 rv &= (dig == -1 || (dig != 0) == (des.bits.dig != tile_dig_designation::No));
291 rv &= (hidden == -1 || (hidden != 0) == des.bits.hidden);
292 rv &= (light == -1 || (light != 0) == des.bits.light);
293 rv &= (subterranean == -1 || (subterranean != 0) == des.bits.subterranean);
294 rv &= (skyview == -1 || (skyview != 0) == des.bits.outside);
295 rv &= (aquifer == -1 || (aquifer != 0) == des.bits.water_table);
296 rv &= (aquifer == -1 || (aquifer == 2) == occ.bits.heavy_aquifer);
297 return rv;
298 }
299};
300
301struct PaintResult {

Callers 2

paintAreaFunction · 0.45
paintTileFunction · 0.45

Calls 5

tileShapeFunction · 0.85
isStoneMaterialFunction · 0.85
tileMaterialFunction · 0.85
tileSpecialFunction · 0.85
tileVariantFunction · 0.85

Tested by

no test coverage detected