public static bool AutoSaveCurrentGame(CampaignSaveMetaDataArgs campaignMetaData)
        {
            MetaData saveMetaData = MBSaveLoad.GetSaveMetaData(campaignMetaData);

            MBSaveLoad.IncrementAutoSaveIndex();
            string autoSaveName = MBSaveLoad.GetAutoSaveName();

            return(MBSaveLoad.OverwriteSaveFile(saveMetaData, autoSaveName));
        }
        public static bool SaveAsCurrentGame(CampaignSaveMetaDataArgs campaignMetaData, string saveName)
        {
            int num = MBSaveLoad.OverwriteSaveFile(MBSaveLoad.GetSaveMetaData(campaignMetaData), saveName) ? 1 : 0;

            if (num == 0)
            {
                return(num != 0);
            }
            MBSaveLoad.ActiveSaveSlotName = saveName;
            return(num != 0);
        }
        public static bool QuickSaveCurrentGame(CampaignSaveMetaDataArgs campaignMetaData)
        {
            MetaData saveMetaData = MBSaveLoad.GetSaveMetaData(campaignMetaData);

            if (MBSaveLoad.ActiveSaveSlotName == null)
            {
                MBSaveLoad.ActiveSaveSlotName = MBSaveLoad.GetNextAvailableSaveName();
            }
            string activeSaveSlotName = MBSaveLoad.ActiveSaveSlotName;

            return(MBSaveLoad.OverwriteSaveFile(saveMetaData, activeSaveSlotName));
        }
        private static MetaData GetSaveMetaData(CampaignSaveMetaDataArgs data)
        {
            MetaData          metaData = new MetaData();
            List <ModuleInfo> modules  = MBSaveLoad.GetModules(data.ModuleNames);

            metaData["Modules"] = string.Join(";", modules.Select <ModuleInfo, string>((Func <ModuleInfo, string>)(q => q.Name)));
            foreach (ModuleInfo moduleInfo in modules)
            {
                metaData["Module_" + moduleInfo.Name] = moduleInfo.Version.ToString();
            }
            metaData.Add("ApplicationVersion", ApplicationVersion.FromParametersFile(ApplicationVersionGameType.Singleplayer).ToString());
            metaData.Add("CreationTime", DateTime.Now.ToString());
            foreach (KeyValuePair <string, string> keyValuePair in data.OtherData)
            {
                metaData.Add(keyValuePair.Key, keyValuePair.Value);
            }
            return(metaData);
        }