MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / operator()

Method operator()

src/station_gui.cpp:1166–1180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1164}
1165
1166bool CargoSorter::operator()(const CargoDataEntry &cd1, const CargoDataEntry &cd2) const
1167{
1168 switch (this->type) {
1169 case CargoSortType::StationID:
1170 return this->SortId<StationID>(cd1.GetStation(), cd2.GetStation());
1171 case CargoSortType::CargoType:
1172 return this->SortId<CargoType>(cd1.GetCargo(), cd2.GetCargo());
1173 case CargoSortType::Count:
1174 return this->SortCount(cd1, cd2);
1175 case CargoSortType::StationString:
1176 return this->SortStation(cd1.GetStation(), cd2.GetStation());
1177 default:
1178 NOT_REACHED();
1179 }
1180}
1181
1182template <class Tid>
1183bool CargoSorter::SortId(Tid st1, Tid st2) const

Callers 1

operator()Method · 0.95

Calls 5

SortCountMethod · 0.95
SortStationMethod · 0.95
NOT_REACHEDFunction · 0.85
GetStationMethod · 0.80
GetCargoMethod · 0.80

Tested by

no test coverage detected