Checking whether an object is an instance of a class or its subclasses

Pages: 12
Thanks, m4ster r0shi, your message is very insightful, but...
You see, I'm not actually creating a game. I'm just making the "base" or "engine" or whatever it's called, on top of which it should be possible to create games. And I want it to be board enough so that games made with it may not have enemies, for instance. They may not have a player, and for all I know they may not even have any actor at all.

nor makes darkestfright happy (as you still have
to use dynamic_cast after you find out that the object is of the type you want) :P
No, I don't :). Look at my last code.
Last edited on
The engine should do little more than handling resources and providing optimized interfaces for certain specialized operations (e.g. a pathfinding function). Why are you concerning yourself with a class hierarchy?
I just want my engine to take care of more stuff. E.g. the main loop.
Last edited on
Topic archived. No new replies allowed.
Pages: 12