Page 1 of 1

Saving a queue of enums

Posted: Fri Aug 30, 2019 3:43 pm
by JustiNoPot
Hi there,

I would like to save a queue of enums but I am having issues, how can I do this? I have the queue stored in a class called GameData, so ideally I would be able to simply save it as part of GameData (which is an ES2UserType I have already defined that contains various primitives (ints, bools, etc.)), but I can't even seem to save the queue of enums as a standalone data type.
I also tried creating a wrapper like what is seen here: https://docs.moodkie.com/easy-save-2/su ... ollections -> where the wrapper simply holds the queue of enums, but this doesn't seem to work either
When I try, easy save simply says that it is not supported

Please help

Re: Saving a queue of enums

Posted: Sat Aug 31, 2019 7:25 am
by Joel
Hi there,

Firstly, I would strongly recommend using Easy Save 3, as Easy Save 2 is only included for backwards compatibility.

With regards to saving and loading Queues of enums, you can do so with the ES2.Save(myQueue, "myQueue") and myQueue = ES2.LoadQueue<EnumType>("myQueue").

With Easy Save 3, you can do this using ES3.Save<Queue<EnumType>>("myQueue", myQueue) and myQueue = ES3.Load<Queue<EnumType>>("myQueue").

All the best,
Joel