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

Method GetNumEngines

src/group_cmd.cpp:68–73  ·  view source on GitHub ↗

* Get number of vehicles of a specific engine ID. * @param engine Engine ID. * @returns number of vehicles of this engine ID. */

Source from the content-addressed store, hash-verified

66 * @returns number of vehicles of this engine ID.
67 */
68uint16_t GroupStatistics::GetNumEngines(EngineID engine) const
69{
70 auto found = this->num_engines.find(engine);
71 if (found != std::end(this->num_engines)) return found->second;
72 return 0;
73}
74
75/**
76 * Returns the GroupStatistics for a specific group.

Callers 1

GetGroupNumEnginesFunction · 0.45

Calls 2

endFunction · 0.50
findMethod · 0.45

Tested by

no test coverage detected