| 219 | } |
| 220 | |
| 221 | static std::string GetAircraftEngineInfoString(const Engine &e) |
| 222 | { |
| 223 | std::stringstream res; |
| 224 | |
| 225 | res << GetString(STR_ENGINE_PREVIEW_COST_MAX_SPEED, e.GetCost(), PackVelocity(e.GetDisplayMaxSpeed(), e.type)); |
| 226 | res << '\n'; |
| 227 | |
| 228 | if (uint16_t range = e.GetRange(); range > 0) { |
| 229 | res << GetString(STR_ENGINE_PREVIEW_TYPE_RANGE, e.GetAircraftTypeText(), range); |
| 230 | res << '\n'; |
| 231 | } else { |
| 232 | res << GetString(STR_ENGINE_PREVIEW_TYPE, e.GetAircraftTypeText()); |
| 233 | res << '\n'; |
| 234 | } |
| 235 | |
| 236 | res << GetPreviewRunningCostString(e); |
| 237 | res << '\n'; |
| 238 | |
| 239 | CargoType cargo = e.GetDefaultCargoType(); |
| 240 | uint16_t mail_capacity; |
| 241 | uint capacity = e.GetDisplayDefaultCapacity(&mail_capacity); |
| 242 | if (mail_capacity > 0) { |
| 243 | res << GetString(STR_ENGINE_PREVIEW_CAPACITY_2, cargo, capacity, GetCargoTypeByLabel(CT_MAIL), mail_capacity); |
| 244 | } else { |
| 245 | res << GetString(STR_ENGINE_PREVIEW_CAPACITY, cargo, capacity); |
| 246 | } |
| 247 | |
| 248 | return res.str(); |
| 249 | } |
| 250 | |
| 251 | static std::string GetRoadVehEngineInfoString(const Engine &e) |
| 252 | { |
no test coverage detected