Hello,
I'm still learning C++, and I have a question that I'm not even sure how to search for it, so sorry if this is a repeat.
The thing is that I'm trying to make, for a project a-for lack of a better word-memory manager. I want to have kind of a "database" or something of all "actors", but I want to be able to ask for things like:
"I want all actors that are of type SOMETYPE and intersect SOMECONVEX and that have SOMEFLAG set". And of course, it would be great if the actors would be dynamic_cast down to SOMETYPE, since I use a lot of inheritance.
Of course, sometimes I'll want ALL actors, and sometimes I'll want all actors of SOMETYPE that have SOMEFLAG, but not care about what they intersect and so on.
What would be a clean (probably using templates?) way to design such a system? Or if it's already designed, like a "database" or something like that, where would I find something simple?
I can see a very ugly way to design this, which is to save a bunch of different list<Actor> and list<SomeDeriveClass> and so on, and have a ton of different functions.
Is there a clean way?
Anyway, thanks for any advice.