| 17 | |
| 18 | template <typename Tproj> |
| 19 | static uint16_t TownHistoryHelper(const Town *t, CargoLabel label, uint period, Tproj proj) |
| 20 | { |
| 21 | auto it = t->GetCargoSupplied(GetCargoTypeByLabel(label)); |
| 22 | if (it == std::end(t->supplied)) return 0; |
| 23 | |
| 24 | return ClampTo<uint16_t>(std::invoke(proj, it->history[period])); |
| 25 | } |
| 26 | |
| 27 | /* virtual */ uint32_t TownScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const |
| 28 | { |
no test coverage detected