class inheritance & vectors
Hey, i'm making my final text rpg before I move onto direct x and i'm making great progress. I have created an inventory class and a vetor to hold Weapon objects. Now, the question I have to ask is: If I have created multiple classes that inherit all of Weapon's data members and functions(classes would include Sword, Bow, and Staff), would I be able to fill the vector with those classes?
void addW(Weapon* pWeapon);
Inventory.addW(Sword)<-i have no idea how i would add in a sword object, would i have to cast? I really don't know...