Page 2 of 2

Re: How to handle type changes?

Posted: Fri Sep 11, 2020 8:55 am
by Joel
Manufacture43-Daniel wrote: Fri Sep 11, 2020 8:13 amThe strings are already being loaded into memory, it's just a matter of putting them unparsed (unparsed as in not converted to int or float) in dictionaries and lists that would be sent to a callback with the name of their variable to see if the client want to make anything of them. If you don't want to accumulate and wait for the end of the full loading, as this would have a bigger impact on memory, I understand, just call the callbacks as data is gathered.
Hi there,

If there's demand for this then we'd definitely consider implementing this in the way you've described, but happy for you to create your own implementation in the meantime.

All the best,
Joel

Re: How to handle type changes?

Posted: Wed Jun 29, 2022 5:08 pm
by DeliInteractive
Manufacture43-Daniel wrote: Fri Sep 11, 2020 8:13 am If I get the time, I'll implement the change myself and put the diffs here.
Hi there! Was this ever implemented? We'd be really interested in something like the feature you've described in this post. Saves evolve sometimes! :D

Re: How to handle type changes?

Posted: Thu Jun 30, 2022 9:15 am
by Joel
Hi there,

The issue with loading a class as a Dictionary<string, System.Object> is that although the JSON format has three different primitive types, these can represent many different primitive types (i.e. a JSON number could be a decimal, double, float, int, uint, ... etc). When saving data as a System.Object we save type data with it so that it can be loaded (this is one place where we depart from the JSON format). However, unless it's a System.Object, no type data will be stored with it because it's a primitive type and it's assumed that this can be established from the type provided when loading.

In your case if you wanted to load as a Dictionary<string, System.Object>, you would also need to save your data as a Dictionary<string, Object>.

All the best,
Joel