Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<typename Fnc>
- void tgame_load::init_sorting_option(generator_sort_array& order_funcs, Fnc filter_on)
- {
- order_funcs[0] = [this, &filter_on](unsigned i1, unsigned i2) {
- return filter_on(games_[i1]) < filter_on(games_[i2]);
- };
- order_funcs[1] = [this, &filter_on](unsigned i1, unsigned i2) {
- return filter_on(games_[i1]) > filter_on(games_[i2]);
- };
- }
- // Calls
- generator_sort_array order_funcs;
- init_sorting_option(order_funcs, std::bind(&savegame::save_info::name, _1));
- list.set_column_order(0, order_funcs);
- init_sorting_option(order_funcs, std::bind(&savegame::save_info::modified, _1));
- list.set_column_order(1, order_funcs);
- // Definition of games_
- std::vector<savegame::save_info> games_;
Add Comment
Please, Sign In to add comment