* Retrieve a NewGRF from the current config by its grfid. * @param grfid grf to look for. * @param mask GRFID mask to allow for partial matching. * @return The grf config, if it exists, else \c nullptr. */
| 620 | * @return The grf config, if it exists, else \c nullptr. |
| 621 | */ |
| 622 | GRFConfig *GetGRFConfig(uint32_t grfid, uint32_t mask) |
| 623 | { |
| 624 | auto it = std::ranges::find_if(_grfconfig, [grfid, mask](const auto &c) { return (c->ident.grfid & mask) == (grfid & mask); }); |
| 625 | if (it != std::end(_grfconfig)) return it->get(); |
| 626 | |
| 627 | return nullptr; |
| 628 | } |
| 629 | |
| 630 | |
| 631 | /** Build a string containing space separated parameter values, and terminate */ |
no test coverage detected