Sorry for the topic title, I don't really know how to explain it in a short sentence.
I'm making a game and all my entities are stored in a std::map<std::string, Entity*> and I'd want to sort them by their Y axis position(to draw them from top to bottom of the screen), the Entity class has a method getYPos, but I can't figure out how to sort them. I'd appreciate if any of you guys have some advices.
Edit: I wanted to use std::sort but I never used this and don't really understand how to make it works with a std::map.
Edited by Borax Kid, 05 September 2014 - 11:33 AM.