public static System.Threading.Tasks.Task PostSaveGame(System.Threading.Tasks.Task saveTask, Game.GnomanEmpire self, bool fallenKingdom) { return(saveTask.ContinueWith(task => { var saveFile = GetSaveLocation(fallenKingdom, self.CurrentWorld); using (FileStream saveStream = File.Create(saveFile)) { ModDataSaver modDataSaver = new ModDataSaver(saveStream, Instance.ModManager); modDataSaver.Save(); } Instance.ModManager.OnPostSaveGameEvent(new PostSaveGameEventArgs(fallenKingdom)); })); }
public static void PostLoadGame(Game.GnomanEmpire self, string fileName, bool fallenKingdom) { var saveFile = GetSaveLocation(fallenKingdom, self.CurrentWorld); if (File.Exists(saveFile)) { using (FileStream saveStream = File.OpenRead(saveFile)) { ModDataSaver modDataSaver = new ModDataSaver(saveStream, Instance.ModManager); modDataSaver.Load(); } } Instance.ModManager.OnPostLoadGameEvent(new PostLoadGameEventArgs(fallenKingdom)); }