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

Method SortCount

src/station_gui.cpp:1188–1199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1186}
1187
1188bool CargoSorter::SortCount(const CargoDataEntry &cd1, const CargoDataEntry &cd2) const
1189{
1190 uint c1 = cd1.GetCount();
1191 uint c2 = cd2.GetCount();
1192 if (c1 == c2) {
1193 return this->SortStation(cd1.GetStation(), cd2.GetStation());
1194 } else if (this->order == SO_ASCENDING) {
1195 return c1 < c2;
1196 } else {
1197 return c2 < c1;
1198 }
1199}
1200
1201bool CargoSorter::SortStation(StationID st1, StationID st2) const
1202{

Callers 1

operator()Method · 0.95

Calls 3

SortStationMethod · 0.95
GetStationMethod · 0.80
GetCountMethod · 0.45

Tested by

no test coverage detected