Hi everyone. I have a huge problem(for one such as I this is really a problem). In my game I have a lot of subclasses that are magics. Example:
The creatures that has these magics only know a number, for example the magic regenaration has the number 2. But they need to cast this magic on another creature. The magic itself is the class that has a method that apply to the target creature.Code:class Enchantament{ //... }; class Regeneration : Enchantament{ //... }; class Storm : Enchantament{ //... };
So... the owner of the magic needs do instantiate a new object from the desired magic on the target creature.
My first thought was, somehow, out it all in an array, but that is impossible... Is that anyway that I can get a reference to a class and later create an object from it? Maybe rtti...