So, I’m following this tutorial of a C++ inventory system in YouTube.
https://www.youtube.com/watch?v=cPgtd4m5-EI&list=PLitYOdh3OOzhJBCRqYZEGBzJYemA-SH8Z
So, at the start, this guy creates the following C++ classes…
- Empty header “Item Data Structs” : Contains Data Table Row with all the Structs and Enums regarding the database for Items
- UItemBase : The UObject base class that creates copies of the structs of “Item Data Structs”.
- AActor "Pickup : Which inherits the UItemBase.
I just have a general enquiry on this guys method, I’m new to Game Dev so I’m not sure if his setup is common practice, but, I don’t understand why create the header and the UObject class… I feel like they are redundant? I mean, why not have the Data Table Row declared in the PickUp Actor itself, and then create instances of this actor? Isn’t that less complicated?
I know this is probably a basic question… but if his practice is a common one, can you please enlighten me on the logic on why create all those separate classes as opposed to just one class that contains everything…