So I'm writing an RPG and I'm in need of an inventory system. Of course as an relatively old member of the forum I know best than just come here and ask so I've already researched quite a bit and I've formulated this idea. I don't like to spend a lot of time implementing a new system without knowing it's chances so I hope you guys can tell me if this works.
I've kind of conceptualized it like so:
I'll have some sort of STL container of a unique_ptr of my base item class. There will be derived item classes. Taking advantage of polymorphism I can then call the new Derivedclass when inserting it in the STL container.
My questions are:
Does this work?
What STL container should be used for the inventory(fixed sized)?
I'd recommend vector, but since I don't know how you are wanting to do your inventory system I can't give a definite answer or advice on how to go about doing it.