How can I store spell & items using a std::vector implementation?
- by Vladimir Marenus
I'm following along with a book from GameInstitute right now, and it's asking me to:
Allow the player to buy and carry healing potions and potions of
fireball. You can add an Item array (after you define the item class)
to the Player class for storing them, or use a std::vector to store
them.
I think I would like to use the std::vector implementation, because that seems to confuse me less than making an item class, but I am unsure how to do so. I've heard from many people that vectors are great ways to store dynamic values (such as items, weapons, etc), but I've not seen it used.