Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SceneGame::SortObjects()
- {
- auto sorterRaw = []( ObjectPtr it1, ObjectPtr it2 ) -> bool
- {
- auto obj1 = static_cast< DepthObject* >( it1.get() );
- auto obj2 = static_cast< DepthObject* >( it2.get() );
- if ( obj1->GetDepth() == obj2->GetDepth() )
- {
- return false;
- }
- return obj1->GetDepth() > obj2->GetDepth();
- };
- using namespace std::placeholders;
- auto sorter = std::bind( sorterRaw, _1, _2 );
- std::sort( objects.begin(), objects.end(), sorter );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement