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

Method id

src/OpenLoco/src/World/TownManager.cpp:517–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517OpenLoco::TownId OpenLoco::Town::id() const
518{
519 // TODO check if this is stored in Town structure
520 // otherwise add it when possible
521 auto index = static_cast<size_t>(this - &TownManager::rawTowns()[0]);
522 if (index > Limits::kMaxTowns)
523 {
524 return OpenLoco::TownId::null;
525 }
526 return OpenLoco::TownId(index);
527}

Callers 15

drawStationNamesFunction · 0.45
updateTownInfoFunction · 0.45
getClosestTownAndDensityFunction · 0.45
calculateCompanyValueFunction · 0.45
doCalcAcceptedCargoFunction · 0.45
updateAndTakeoverRoadFunction · 0.45
getRoadInformationFunction · 0.45
addRoadJunctionFunction · 0.45
constructBuildingFunction · 0.45

Calls 1

TownIdEnum · 0.85

Tested by

no test coverage detected