Beispiel #1
0
        /// <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);
            }
        }
Beispiel #2
0
        /// <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);
        }