So I have list of item class and different items derive from item class to do different things, thats fine.
Let’s say these are type A items.
Type B items have additional component that do different things and have own stats.
So I want to save on item list, type B item with all data from additional component and went straight up, head first into wall. I have no idea how to handle it.
Maybe fuse additional component into derived item class of type B? But I don’t know how to access it later from list.
Maybe keep refrence to additional in derived item class? But then I got problem with loading items from inventory, there won’t anything to refrence.
All I know that probably there is some c# magic that I just don’t know.
you can use GetType() when you load your item so you will know if its type A or B
Got types in item class. How to get/save data from additional class in B.
make it so class B inherits from A
public class myClassB : myClassA {
I think I need redone whole items. Thanks for brigas for checking the thread.
What I done is unfixable.