예제 #1
0
        public async static void WriteSaveGame(ISaveable _saveable, string _path)
        {
            MemoryStream memStream = new MemoryStream();

            AddValue("Dataversion", version, memStream);


            _saveable.WriteTo(memStream, version);

            FileStream fileStream = new FileStream(_path, FileMode.Create, FileAccess.Write);

            memStream.WriteTo(fileStream);

            //memStream.GetBuffer();

            //write buffer to disc async!
            memStream.Flush();
            memStream.Dispose();

            await fileStream.FlushAsync();

            fileStream.Dispose();

            //ISaveable
        }