* Determines order of engines by reliability * @param a first engine to compare * @param b second engine to compare * @return for descending order: returns true if a < b. Vice versa for ascending order */
| 174 | * @return for descending order: returns true if a < b. Vice versa for ascending order |
| 175 | */ |
| 176 | static bool EngineReliabilitySorter(const GUIEngineListItem &a, const GUIEngineListItem &b) |
| 177 | { |
| 178 | const int va = Engine::Get(a.engine_id)->reliability; |
| 179 | const int vb = Engine::Get(b.engine_id)->reliability; |
| 180 | const int r = va - vb; |
| 181 | |
| 182 | /* Use EngineID to sort instead since we want consistent sorting */ |
| 183 | if (r == 0) return EngineNumberSorter(a, b); |
| 184 | return _engine_sort_direction ? r > 0 : r < 0; |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | * Determines order of engines by purchase cost |
nothing calls this directly
no test coverage detected