I’m wondering how I could save a variable that has inheritance. All my buildings have to save to a single type of struct: SaveStruct_Structure
, so adding unique fields for each structure is pretty annoying. Having a variable that can have inheritance and save would be really helpful.
Up till now I’ve been using a string to string map and parsing the data, but it’s really ugly.
I would’ve preferred something like:
Parent class: SaveObj_BuildingData
Child of said parent: SaveObj_ABuildingsCustomData
Another child of said parent: SaveObj_AnotherBuildingsCustomData
Where in the struct I save I request a SaveObj_BuildingData, and the individual classes can cast it to what they know it is.
But, to my knowledge, you can’t save an object.
I’m not sure how to go about this.