MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / id

Method id

src/OpenLoco/src/World/StationManager.cpp:807–817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

805}
806
807OpenLoco::StationId OpenLoco::Station::id() const
808{
809 // TODO check if this is stored in station structure
810 // otherwise add it when possible
811 auto index = (size_t)(this - &StationManager::rawStations()[0]);
812 if (index >= Limits::kMaxStations)
813 {
814 return StationId::null;
815 }
816 return StationId(index);
817}

Callers 4

updateDailyFunction · 0.45
allocateNewStationFunction · 0.45
findNearbyEmptyStationFunction · 0.45

Calls 1

StationIdEnum · 0.85

Tested by

no test coverage detected