So... here I am again. Items are a pretty important part of RPGs, so I'm probably going to have to code them in at some point. My basic idea is this:
I'll start with an abstract class called "Item". From there, it'll be broken down into several subclasses, including "Equipment" (weapons and armor), "Useable Items" (potions, Phoenix Downs), and Key Items. I have a vague idea of the kind of member functions I would include for both Equipment and Useable items, functions that will increase my characters stats depending on what items he has equipped, and ones that will use up items that I have in my inventory.
My idea (and correct me if I'm wrong, since I probably will be) is to have an array (or vector, I haven't done vectors yet but apparently they're containers of some sort) to store what items that I currently have, whether it's equipment, useable items or key items. Maybe I'll have a separate storage container for each of the sets of items that I have.
To equip/use an item, I was thinking I should have all the contents of each specific container displayed on the screen, with a switch that allows you to choose what item you want to use. Then a member function to iterate (I think that's the term) through the container to the selected index, and finally use/equip the item.
Also another thing, I want to be able to carry quantities of items. So referring to my above plan, I need make sure that 50 potions doesn't take up 50 spaces in my container, or my plan is never going to work.
Any ideas/suggestions/general advice would be great.