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

Method GetAllRailTypes

src/script/api/script_engine.cpp:251–262  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

249}
250
251/* static */ ScriptList *ScriptEngine::GetAllRailTypes(EngineID engine_id)
252{
253 if (!IsValidEngine(engine_id)) return nullptr;
254 if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL) return nullptr;
255
256 ScriptList *list = new ScriptList();
257 for (::RailType railtype : ::RailVehInfo(engine_id)->railtypes) {
258 list->AddItem(railtype);
259 }
260
261 return list;
262}
263
264/* static */ bool ScriptEngine::IsArticulated(EngineID engine_id)
265{

Callers

nothing calls this directly

Calls 2

RailVehInfoFunction · 0.85
AddItemMethod · 0.80

Tested by

no test coverage detected