コード例 #1
0
        /// <summary>
        /// Converts any save values from previous versions to new save values.
        /// </summary>
        /// <param name="saveData">
        /// The save data.
        /// </param>
        /// <returns>
        /// The converted save data.
        /// </returns>
        public static SaveData ConvertSaveData(SaveData saveData)
        {
            if (saveData.Version == null || saveData.Version.Major < 1 ||
                (saveData.Version.Major == 1 && (saveData.Version.Minor < 4 ||
                                                 (saveData.Version.Minor == 4 && saveData.Version.Build <= 1))))
            {
                if (saveData.Locations != null)
                {
                    foreach (var location in saveData.Locations.Values)
                    {
                        MarkingConverter.ConvertFrom141(location);
                    }
                }
            }

            return(saveData);
        }
コード例 #2
0
ファイル: SaveData.cs プロジェクト: powerlord/OpenTracker
        /// <summary>
        /// Loads data from this class.
        /// </summary>
        public void Load()
        {
            if (Version.Major < 1 || (Version.Major == 1 &&
                                      (Version.Minor < 4 ||
                                       (Version.Minor == 4 && Version.Build <= 1))))
            {
                foreach (var location in Locations.Values)
                {
                    MarkingConverter.ConvertFrom141(location);
                }
            }

            Modes.Mode.Instance.Load(Mode);
            ItemDictionary.Instance.Load(Items);
            LocationDictionary.Instance.Load(Locations);
            BossPlacementDictionary.Instance.Load(BossPlacements);
            PrizePlacementDictionary.Instance.Load(PrizePlacements);
            ConnectionCollection.Instance.Load(Connections);

            if (Dropdowns != null)
            {
                DropdownDictionary.Instance.Load(Dropdowns);
            }
        }