* Sorts the save game list. * @param sort Order to sort the games in. */
| 232 | * @param sort Order to sort the games in. |
| 233 | */ |
| 234 | void 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 |
nothing calls this directly
no test coverage detected