C++ Text RPG - Player Inventory - Inheritance?

Nessoldaccount

Senior member
Jun 4, 2000
483
0
0
Hello,

I'm working on a text RPG and need to set up the player's inventory structure. This is what I want.

1) A backpack vector, a vector for what the person is wearing, and variables for what is in the hands.

2) The backpack vector can hold any type of item. Containers (which hold any type of item), weapons, armor, potions, etc. If it is too difficult, I won't do containers.

I have some code. How could I properly implement this? How can I make a vector that will allow any type of item to be in it?

Here's some crap code I have now. The inheritance code I just stuck in there, I was using it to try making items before.

EDIT: Damn, the code pasted like CRAP. it's not readable. sorry.....:(