Inventory and item class design
I have never done anything like that before so i am asking. Aim is getting a design can be implemented simple but can be extended later.
Idea is : Lets start by writing an item class: Having fields like name, icon, mesh, may be a few more generic properties i cant think right now. Then create an inventory class: Keeps a list of items in inventory with a method like List inventory list Then later extending item classes like weapons class, or armor, or consumables or may be items like keys, medals etc all can have their own unique properties like different method; a weapon can attack, some items have stats other may enable player to perform some actions etc Will inventory list still functions (because all item derivations extended on item class) Or we just can't list them because they are different data structures (having non-common data types etc)
Also is this a proper way to do it, or how it can be improved ?
Your answer
Follow this Question
Related Questions
Problem with using an item from inventory 0 Answers
How to handle inventory in 2d game, via xml, no game objects (inheritance? interface?) 0 Answers
Trouble with inheritance 2 Answers
GravityBody hides Rigidbody 1 Answer
Best OOP practice for grandchild class calling methods from its parent 1 Answer