MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / sortList

Method sortList

src/Menu/ListGamesState.cpp:234–252  ·  view source on GitHub ↗

* Sorts the save game list. * @param sort Order to sort the games in. */

Source from the content-addressed store, hash-verified

232 * @param sort Order to sort the games in.
233 */
234void ListGamesState::sortList(SaveSort sort)
235{
236 switch (sort)
237 {
238 case SORT_NAME_ASC:
239 std::sort(_saves.begin(), _saves.end(), compareSaveName(false));
240 break;
241 case SORT_NAME_DESC:
242 std::sort(_saves.rbegin(), _saves.rend(), compareSaveName(true));
243 break;
244 case SORT_DATE_ASC:
245 std::sort(_saves.begin(), _saves.end(), compareSaveTimestamp(false));
246 break;
247 case SORT_DATE_DESC:
248 std::sort(_saves.rbegin(), _saves.rend(), compareSaveTimestamp(true));
249 break;
250 }
251 updateList();
252}
253
254/**
255 * Updates the save game list with the current list

Callers

nothing calls this directly

Calls 2

compareSaveNameClass · 0.85

Tested by

no test coverage detected