Saving a queue of enums

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
JustiNoPot
Posts: 3
Joined: Thu Jan 31, 2019 5:03 pm

Saving a queue of enums

Post 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
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving a queue of enums

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Locked