Upgrading sequential ES2Writer/Reader to ES3

Discussion and help for Easy Save 3
Post Reply
sonoframbo
Posts: 1
Joined: Wed Jun 14, 2017 2:12 am

Upgrading sequential ES2Writer/Reader to ES3

Post by sonoframbo »

Hi,

I'm trying to upgrade to ES3. I've been using the sequential write & read following this page on the doc.
http://docs.moodkie.com/easy-save-2/gui ... es2reader/

The Create() now needs a ES3Setting which I put in with defaults.
It's able to write to file in sequence but when I read the file it tries to read it as a json with keys instead of sequentially.
What would be the ES3 equivalent?

Thanks!


using(ES2Writer writer = ES2Writer.Create("myFile.txt"))
{
// Write our data to the file in the order we are going to read it.
writer.Write(this.name);
writer.Write(this.transform);
writer.Write(new int[]{1,2,3});
// Remember to save when we're done.
writer.Save(false);
}

using(ES2Reader reader = ES2Reader.Create("myFile.txt"))
{
// Read the data from the file in the same order as we saved it.
this.name = reader.Read<string>();
reader.Read<Transform>(this.transform);
int[] myIntArray = reader.ReadArray<int>();
}
User avatar
Joel
Moodkie Staff
Posts: 4852
Joined: Wed Nov 07, 2012 10:32 pm

Re: Upgrading sequential ES2Writer/Reader to ES3

Post by Joel »

Hi there,

There's not currently access to readers/writers except through ES3Types, but access will be added at a later date as we're only testing the core functionality at the moment.

However, ES3Files have a very similar performance footprint to sequential writing, and are documented HERE.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply