I know I'm missing something simple to get this working-
I'm using EasySave3 and saving using the ES3File function- I have a fully working save/load system with all other types except dictionaries-
What is the syntax to Save/Load a Dictionary of <string,float> using EasySave3? Using an ES3File to save to?
Could anyone just post two lines of code- save and load for this purpose? Thank you.
Syntax to save Dictionary<string, float> using ES3?
-
- Posts: 11
- Joined: Fri Aug 19, 2016 11:57 pm
Re: Syntax to save Dictionary<string, float> using ES3?
Hi there,
The code would be:
Joel
The code would be:
var file = new ES3File(); // Create an ES3File using the default file name. file.Save<Dictionary<string,float>>("myDictionary", myDictionary); // Save a dictionary to the ES3File. file.Sync(); // Write file to disk.All the best,
Joel
-
- Posts: 11
- Joined: Fri Aug 19, 2016 11:57 pm
Re: Syntax to save Dictionary<string, float> using ES3?
Here's the answer for anyone else that needs it-
Code: Select all
//file is ES3File
//To Save
file.Save<Dictionary<string,float>>("DataDict",dict);
//To Load
file.Load<Dictionary<string, float>>("DataDict");
-
- Posts: 11
- Joined: Fri Aug 19, 2016 11:57 pm
Re: Syntax to save Dictionary<string, float> using ES3?
Thanks Joel! I had just figured it out and posted at the same time as you ^_^ Cheers and thanks again for the great product
Re: Syntax to save Dictionary<string, float> using ES3?
No problem, let me know if you run into any other issuesmdotstrange wrote:Thanks Joel! I had just figured it out and posted at the same time as you ^_^ Cheers and thanks again for the great product
- Joel