Beispiel #1
0
        public static Save_Info get_save_info(int file_id, Save_File file, bool suspend)
        {
            Save_Info result = new Save_Info();

            result.File_Id = file_id;

            result.Time = new DateTime(); //@Yeti
            var mostRecent = file.most_recent_save;

            if (mostRecent != null)
            {
                result.Time = mostRecent.time;
            }

            result.Style           = file.Style;
            result.Map_Save_Exists = false;
            result.Suspend_Exists  = suspend;

            if (file.NoData)
            {
                result.Chapter_Id = "";
                result.Difficulty = file.Difficulty;
            }
            else
            {
                Save_Data data = file.most_recent_save;
                result.Chapter_Id = data.chapter_id;
                result.Difficulty = data.difficulty;
                //result.Chapter_Id = file.data[chapter_id][indices[index]].chapter_id; //Debug
                //result.Difficulty = file.data[chapter_id][indices[index]].difficulty;
            }

            result.get_save_info(file);
            return(result);
        }
Beispiel #2
0
 public Save_Info(Save_Info info)
 {
     File_Id           = info.File_Id;
     Time              = info.Time;
     Chapter_Id        = info.Chapter_Id;
     Difficulty        = info.Difficulty;
     Style             = info.Style;
     Map_Save_Exists   = info.Map_Save_Exists;
     Suspend_Exists    = info.Suspend_Exists;
     AvailableChapters = new List <string>(info.AvailableChapters);
 }
Beispiel #3
0
        public static Save_Info new_file()
        {
            Save_Info result = new Save_Info();

            result.File_Id         = Global.start_game_file_id;
            result.Difficulty      = Global.save_file.Difficulty;
            result.Style           = Global.save_file.Style;
            result.Map_Save_Exists = false;
            result.Suspend_Exists  = false;
            return(result);
        }
Beispiel #4
0
        public static Save_Info get_save_info(int file_id, Save_File file, Suspend_Info suspend_info, bool map_save = false, bool suspend = false)
        {
            Save_Info result = new Save_Info();

            result.File_Id = file_id;

            result.Time            = suspend_info.time;
            result.Style           = suspend_info.style;
            result.Map_Save_Exists = map_save;
            result.Suspend_Exists  = suspend;

            result.Chapter_Id = suspend_info.chapter_id;
            result.Difficulty = suspend_info.difficulty;

            result.get_save_info(file);
            return(result);
        }
Beispiel #5
0
        public void CopyTransientInfo(Save_Info sourceInfo)
        {
            if (!string.IsNullOrEmpty(sourceInfo.LastStartedChapter))
            {
                LastStartedChapter = sourceInfo.LastStartedChapter;
            }

            if (sourceInfo.LastStartTime != new DateTime())
            {
                if (sourceInfo.LastStartTime > LastStartTime)
                {
                    LastStartTime = sourceInfo.LastStartTime;
                }

                if (sourceInfo.LastStartTime > Time)
                {
                    Time = sourceInfo.LastStartTime;
                }
            }
        }