OpenTTD Source 20261112-master-gbcbec5e63f
CargoTypeComparator Struct Reference

Comparator to sort CargoType by according to desired order. More...

#include <cargotype.h>

Public Member Functions

bool operator() (const CargoType &lhs, const CargoType &rhs) const
 Call operator that performs the comparison.

Detailed Description

Comparator to sort CargoType by according to desired order.

Definition at line 294 of file cargotype.h.

Member Function Documentation

◆ operator()()

bool CargoTypeComparator::operator() ( const CargoType & lhs,
const CargoType & rhs ) const
inline

Call operator that performs the comparison.

Parameters
lhsCargo to compare that is in previous spot in the sorted container.
rhsCargo to compare that is in later spot in the sorted container.
Returns
true iff the lhs and rhs should be swapped in order to sort the container.

Definition at line 301 of file cargotype.h.

References _sorted_cargo_types.


The documentation for this struct was generated from the following file: