| 229 | } |
| 230 | |
| 231 | bool 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 | |
| 252 | bool MaterialInfo::findPlant(const std::string& token, const std::string& subtoken) |
| 253 | { |
no test coverage detected