alecthomas / entityx

EntityX - A fast, type-safe C++ Entity-Component system
MIT License
2.22k stars 295 forks source link

Is there a way to sort? #147

Closed neverender closed 8 years ago

neverender commented 8 years ago

I would like to use entityx to render stuff. To render efficiently, I need to be able to sort what I get from entities_with_components. For instance: sort by texture_component->filename. Is this possible?

alecthomas commented 8 years ago

I assume you mean "can EntityX maintain components in sorted order", and the answer is no it can not. Your best bet is to sort the iterator returned by entities_with_components().