MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetEngineInfoString

Function GetEngineInfoString

src/engine_gui.cpp:296–315  ·  view source on GitHub ↗

* Get a multi-line string with some technical data, describing the engine. * @param engine Engine to describe. * @return String describing the engine. * @post \c DParam array is set up for printing the string. */

Source from the content-addressed store, hash-verified

294 * @post \c DParam array is set up for printing the string.
295 */
296std::string GetEngineInfoString(EngineID engine)
297{
298 const Engine &e = *Engine::Get(engine);
299
300 switch (e.type) {
301 case VEH_TRAIN:
302 return GetTrainEngineInfoString(e);
303
304 case VEH_ROAD:
305 return GetRoadVehEngineInfoString(e);
306
307 case VEH_SHIP:
308 return GetShipEngineInfoString(e);
309
310 case VEH_AIRCRAFT:
311 return GetAircraftEngineInfoString(e);
312
313 default: NOT_REACHED();
314 }
315}
316
317/**
318 * Draw an engine.

Callers 4

UpdateWidgetSizeMethod · 0.85
DrawWidgetMethod · 0.85
UpdateWidgetSizeMethod · 0.85
DrawWidgetMethod · 0.85

Calls 5

GetTrainEngineInfoStringFunction · 0.85
GetShipEngineInfoStringFunction · 0.85
NOT_REACHEDFunction · 0.85

Tested by

no test coverage detected