EasyAPI icon indicating copy to clipboard operation
EasyAPI copied to clipboard

Easy Storage handling with callbacks

Open EnochMiningCorporation opened this issue 10 years ago • 2 comments

This is a TODO (I'm happy to do this work):

Provide a means for EasyAPI users to easily save/restore state to/from Storage, using callbacks such as:

public virtual Dictionary<string, string> onSaveState(Dictionary<string, string> outState); public virtual void onRestoreState(Dictionary<string, string> state);

And using a format to serialise/deserialise data.*

The idea with passing outState into the onSaveState callback is so EasyAPI itself/modules can include any state saving they may need to do internally, and EasyAPI users can simply add to that.

*I've noticed you can't put newlines into the Storage string, so can't use newline as a key-value pair delimiter like with DetailedInfo. Need to select an appropriate (least potentially conflicting) delimiter for Storage.

EnochMiningCorporation avatar May 16 '15 08:05 EnochMiningCorporation

I've not been SE scripting so much lately, and I see much movement in SE's programmable block features...particularly the work LordDevious is doing, effectively implementing a lot of EasyAPI features into SE. Given there's talk about providing a better means of accessing and serializing to Storage, I doubt I'll implement this feature in EasyAPI. Let's see what happens :)

EnochMiningCorporation avatar Jul 24 '15 11:07 EnochMiningCorporation

Yeah, I haven't been doing much SE scripting lately either since the source code for SE was released.

rockyjvec avatar Jul 24 '15 17:07 rockyjvec