예제 #1
0
        public static Suspend_Info read(BinaryReader reader)
        {
            Suspend_Info result = new Suspend_Info();

            result.Chapter_Id      = reader.ReadString();
            result.Lord_Actor_Face = reader.ReadString();
            result.Turn            = reader.ReadInt32();
            result.Units           = reader.ReadInt32();
            result.Playtime        = reader.ReadInt32();
            result.Gold            = reader.ReadInt32();
            result.Save_Id         = reader.ReadInt32();
            if (!Global.LOADED_VERSION.older_than(0, 5, 4, 0))
            {
                result.Preparations = reader.ReadBoolean();
                result.HomeBase     = reader.ReadBoolean();
            }
            else
            {
                result.Preparations = result.Turn <= 0;
                result.HomeBase     = false;
            }
            result.Difficulty = (Difficulty_Modes)reader.ReadInt32();
            result.Style      = (Mode_Styles)reader.ReadInt32();
            result.Time       = DateTime.FromBinary(reader.ReadInt64());
            if (!Global.LOADED_VERSION.older_than(0, 5, 7, 0))
            {
                result.ScreenshotData = result.ScreenshotData.read(reader);
            }

            return(result);
        }
예제 #2
0
 private void open_preview(IO.Suspend_Info info)
 {
     Suspend_Panel     = new Suspend_Info_Panel(false, info);
     Suspend_Panel.loc = MenuLoc +
                         new Vector2(0, -8 + PanelNodes.ActiveNodeIndex * 24);
     Suspend_Panel.stereoscopic = Config.TITLE_MENU_DEPTH;
 }
예제 #3
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);
        }
예제 #4
0
        private Suspend_Info(Suspend_Info source)
        {
            Chapter_Id      = source.Chapter_Id;
            Lord_Actor_Face = source.Lord_Actor_Face;
            Turn            = source.Turn;
            Units           = source.Units;
            Playtime        = source.Playtime;
            Gold            = source.Gold;
            Save_Id         = source.Save_Id;
            Preparations    = source.Preparations;
            HomeBase        = source.HomeBase;
            Difficulty      = source.Difficulty;
            Style           = source.Style;
            Time            = source.Time;
            ScreenshotData  = source.ScreenshotData.ToArray();

            SuspendModifiedTime = source.SuspendModifiedTime;
        }
예제 #5
0
        public static Suspend_Info get_suspend_info(int file_id, byte[] screenshot)
        {
            Suspend_Info result = new Suspend_Info();

            result.Chapter_Id = Global.game_state.chapter_id;
            string lord_face;

            // Use the first unit in the battalion, during preparations
            if (Global.game_system.preparations && Global.battalion.actors.Count > 0)
            {
                lord_face = Global.game_actors[Global.battalion.actors[0]].face_name;
            }
            // Use team leader
            else if (Global.game_map.team_leaders[Constants.Team.PLAYER_TEAM] != -1 &&
                     Global.game_map.units.ContainsKey(Global.game_map.team_leaders[Constants.Team.PLAYER_TEAM]))
            {
                lord_face = Global.game_map.units[Global.game_map.team_leaders[Constants.Team.PLAYER_TEAM]].actor.face_name;
            }
            else
            {
                lord_face = "";
            }
            result.Lord_Actor_Face = lord_face;
            result.Turn            = Global.game_system.chapter_turn;
            result.Units           = Global.game_map.teams[Constants.Team.PLAYER_TEAM].Count;
            result.Playtime        = Global.game_system.total_play_time;
            result.Gold            = Global.battalion.gold;
            result.Save_Id         = file_id;
            result.Preparations    = Global.game_system.preparations;
            result.HomeBase        = Global.game_system.home_base;
            result.Difficulty      = Global.game_system.Difficulty_Mode;
            result.Style           = Global.game_system.Style;
            result.Time            = DateTime.Now;
            if (screenshot != null)
            {
                result.ScreenshotData = screenshot;
            }

            return(result);
        }