So, For this Item design.
Item is such a generic term, so I will call the instanced Item GameItem. It is a UObject and Has a Level (int) and an Item (Item).
Then, the Item which is a Primary Data Asset, has a Parent Type (Item), name (Text), Thumbnail (Texture).
Now, looking at other types, there’s Equipment which has a mesh and a method to get a viable slot. But what IS it?
It too needs a Name and thumbnail. If I inherit Equipment from Item, then it has those properties. But then I’m doing inheritance.
If it IS something other than an Item, it should Have a Parent Type (Item). But in order to Get the Name of the Equipment, it has to implement a method to Get the Name of the Item.
And the Weapon type would have to have methods for all its types.
If going with the Has a - pattern, what would a weapon look like? There would have to be an object called Weapon_Excalibur. It has the Equipment_Excalibur Equipment. It has the Item_Excalibur Item with the name property = Excalibur.
With Inheritance, it would just be the one object, Excalibur, is a Weapon, is an Equipment, is an Item.
At this point, Type Object pattern doesn’t seem lucrative at all.
Some other aspects.
Equipment has a StatMod. Whatever that is. Equipment can modify the stats of the wearer. So what is a StatMod? If it is another data asset, there would have to be an asset for each StatMod. Say I want an Equipment to Modify Armour by 10 points. An object just for that seems ridiculous. If StatMod is just a value, it’s just that more customizable.
But Perks can also have StatMods. And so can Effects.
So right now I’m trying to figure out just what IS a perk? What IS an effect or a spell or weapon. What do they HAVE? and what are their relations.
To be continued…
