The short version:
If I have an array of Object-extending class instances containing data, some of which have been created by the user, how should I be trying to save that data? I've been trying to use a custom Resource with a single property that holds the array, but for a bunch of different reasons that hasn't worked and I feel like I'm missing something/trying to use the wrong tool for the job. Any thoughts?
The details:
I'm making a small app for meal planning. I have a Meal class which extends Object and stores data about a single meal (e.g. its ID, name, etc). Meals are stored in an array which is read from/written to during the usage of the app. There's supposed to be a short list of meals stored in this array when the app is first started, but more meals can be created by the user and added to it.
What I've been trying to make work is using a custom Resource to save and load my meal data. I have a script (meal_data.gd) which extends Resource and has a single property - an array called meals. In its _init(), it creates five Meals (the starting data) and adds them to the array. There is also meal_data.tres which uses the meal_data.gd script.
As I typed this up I realized that I don't have it working at all anymore, though it partially was earlier. I've done a bunch of reading on using Resources but I'm sure I'm missing something. Any suggestions as to how to restructure this or silly things I'm forgetting are very welcome.