I am working on a game that has monsters and dragons. Dragons can do everything monsters can do except they can also breathe fire.
I have made a class of type 'monster' and a class that inherits from monster called 'dragon'.
I then have a class called 'monsters' which has as a private member vector which will contain dragon and monster elements.
In the main game loop I need to cycle through the vector and blow fire if the current element is a dragon, and do nothing if it is just a monster.
I have tried using typeid() but it always returns monster* whether the current element is a plain monster or a dragon.
Is there any way to do this or does it not make sense to even use inheritance in this case? Would it make more sense for the dragon class to not inherit, and to instead stand by itself independent of monster?
Any advice is appreciated.