| 294 | } |
| 295 | |
| 296 | bool MaterialInfo::findProduct(df::material* material, const std::string& name) |
| 297 | { |
| 298 | if (!material || name.empty()) |
| 299 | return decode(-1); |
| 300 | |
| 301 | auto& pids = material->reaction_product.id; |
| 302 | for (size_t i = 0; i < pids.size(); i++) |
| 303 | if ((*pids[i]) == name) |
| 304 | return decode(material->reaction_product.material, i); |
| 305 | |
| 306 | return decode(-1); |
| 307 | } |
| 308 | |
| 309 | std::string MaterialInfo::getToken() const |
| 310 | { |
no test coverage detected