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

Method findBuiltin

library/modules/Materials.cpp:210–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210bool MaterialInfo::findBuiltin(const std::string& token)
211{
212 if (token.empty())
213 return decode(-1);
214
215 if (token == "NONE")
216 {
217 decode(-1);
218 return true;
219 }
220
221 auto& raws = world->raws;
222 for (int i = 0; i < NUM_BUILTIN; i++)
223 {
224 auto obj = raws.mat_table.builtin[i];
225 if (obj && obj->id == token)
226 return decode(i, -1);
227 }
228 return decode(-1);
229}
230
231bool MaterialInfo::findInorganic(const std::string& token)
232{

Callers 1

guess_job_materialFunction · 0.80

Calls 2

decodeFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected