Пример #1
0
        public static Save_Progress read(BinaryReader reader, Version loaded_version)
        {
            Save_Progress result = new Save_Progress();

            var completed = new Dictionary <int, HashSet <string> >();

            completed.read(reader);
            result.CombineCompleted(completed);

            //if (Global.LOADED_VERSION.older_than(0, 6, 1, 0)) //Debug
            if (loaded_version.older_than(0, 6, 1, 0))
            {
                Dictionary <int, HashSet <string> > available = new Dictionary <int, HashSet <string> >();
                available.read(reader);
                result.Available_Chapters = new HashSet <string>(
                    available.Values.SelectMany(x => x));
            }
            else
            {
                result.Available_Chapters.read(reader);
            }
            result.Supports.read(reader);
            if (!loaded_version.older_than(0, 6, 7, 3))
            {
                result.RecruitedActors.read(reader);
                result.PlayedBgms.read(reader);
            }

            return(result);
        }
Пример #2
0
 public void combine_progress(Save_Progress source_progress)
 {
     // Completed Chapters
     CombineCompleted(source_progress.Completed_Chapters);
     // Available Chapters
     Available_Chapters.UnionWith(source_progress.Available_Chapters);
     // Supports
     foreach (var pair in source_progress.Supports)
     {
         if (!Supports.ContainsKey(pair.Key))
         {
             Supports.Add(pair.Key, 0);
         }
         Supports[pair.Key] = Math.Max(Supports[pair.Key], source_progress.Supports[pair.Key]);
     }
     // Recruited
     RecruitedActors.UnionWith(source_progress.RecruitedActors);
     // Bgm
     PlayedBgms.UnionWith(source_progress.PlayedBgms);
 }