Inheritance and Array question

Hello, i am making a small project with a group of people, we taught of storing the Spells (each one is different but all inherit from Spells) in a map

std::map<std::string, Spell*> spells; <

i store a Flare() in "Flare", but is there a way that when i get it back, to store it in a Flare again? it outputs as a Spell, but with all of Flare's properties
If I have correctly understood what you want then you can use dynjamic_cast<Flare *> and define interface functions in Spell as virtual.
Last edited on
exactly what i was looking for, thanks
Topic archived. No new replies allowed.