| 1164 | } |
| 1165 | |
| 1166 | bool 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 | |
| 1182 | template <class Tid> |
| 1183 | bool CargoSorter::SortId(Tid st1, Tid st2) const |
no test coverage detected