/// <summary> /// Loads the program user data config and returns a collection of /// quests. /// </summary> /// <returns>Returns the quests wrapper to store data in.</returns> public static QuestCollectionWrapper Load() { QuestCollectionWrapper questsWrapper = new QuestCollectionWrapper(); List <Configuration> configs = NetTallyConfigHelper.GetConfigsToLoadFrom(); ReadConfigInformation(configs, questsWrapper); return(questsWrapper); }
/// <summary> /// Saves the data from the specified quests wrapper into the config file. /// Tries to save in both the portable location (same directory as the executable), /// and to the roaming location (AppData). /// The portable location is transferable between computers without needing /// a corresponding user account, while the roaming location keeps data from /// being lost if you unzip a new version of the program to a differently-named /// folder. /// </summary> /// <param name="quests">The quests wrapper.</param> public static void Save(QuestCollection quests, string currentQuest, AdvancedOptions options) { // If there's nothing to save, don't do anything. if (quests == null) { return; } // Write to each config location (portable and roaming) List <Configuration> configs = NetTallyConfigHelper.GetConfigsToWriteTo(); foreach (var config in configs) { WriteConfigInformation(config, quests, currentQuest, options); } }
/// <summary> /// Saves the data from the specified quests wrapper into the config file. /// Tries to save in both the portable location (same directory as the executable), /// and to the roaming location (AppData). /// The portable location is transferable between computers without needing /// a corresponding user account, while the roaming location keeps data from /// being lost if you unzip a new version of the program to a differently-named /// folder. /// </summary> /// <param name="questsWrapper">The quests wrapper.</param> public static void Save(QuestCollectionWrapper questsWrapper) { // If there's nothing to save, don't do anything. if (questsWrapper == null) { return; } if (questsWrapper.QuestCollection == null) { return; } // Write to each config location (portable and roaming) List <Configuration> configs = NetTallyConfigHelper.GetConfigsToWriteTo(); foreach (var config in configs) { WriteConfigInformation(questsWrapper, config); } }
/// <summary> /// Loads the program user data config and returns a collection of /// quests. /// </summary> /// <returns>Returns the quests wrapper to store data in.</returns> public static void Load(out QuestCollection quests, out string currentQuest, AdvancedOptions options) { List <Configuration> configs = NetTallyConfigHelper.GetConfigsToLoadFrom(); ReadConfigInformation(configs, out quests, out currentQuest, options); }