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

Method findInorganic

library/modules/Materials.cpp:231–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231bool MaterialInfo::findInorganic(const std::string& token)
232{
233 if (token.empty())
234 return decode(-1);
235
236 if (token == "NONE")
237 {
238 decode(0, -1);
239 return true;
240 }
241
242 auto& raws = world->raws;
243 for (size_t i = 0; i < raws.inorganics.all.size(); i++)
244 {
245 df::inorganic_raw* p = raws.inorganics.all[i];
246 if (p->id == token)
247 return decode(0, i);
248 }
249 return decode(-1);
250}
251
252bool MaterialInfo::findPlant(const std::string& token, const std::string& subtoken)
253{

Callers 3

df_changeveinFunction · 0.80
changelayerFunction · 0.80
processTileTypeFunction · 0.80

Calls 3

decodeFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected