Пример #1
0
        public Api_Result <MissionResultFmt> Result(int deck_rid)
        {
            Api_Result <MissionResultFmt> api_Result = new Api_Result <MissionResultFmt>();
            Mem_deck value = null;

            if (!Comm_UserDatas.Instance.User_deck.TryGetValue(deck_rid, out value))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (value.MissionState != MissionStates.END && value.MissionState != MissionStates.STOP)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (value.Ship.Count() == 0)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (mst_level == null)
            {
                mst_level = Mst_DataManager.Instance.Get_MstLevel(shipTable: true);
            }
            if (mst_userlevel == null)
            {
                mst_userlevel = Mst_DataManager.Instance.Get_MstLevel(shipTable: false);
            }
            int  mission_id = value.Mission_id;
            bool flag       = value.MissionState == MissionStates.STOP;
            Exec_MissionResult exec_MissionResult = new Exec_MissionResult(value, mst_level, mst_userlevel);

            api_Result.data = exec_MissionResult.GetResultData();
            if (!flag)
            {
                QuestMission questMission = new QuestMission(mission_id, value, api_Result.data.MissionResult);
                questMission.ExecuteCheck();
            }
            return(api_Result);
        }
        public Api_Result <MissionResultFmt> Result(int deck_rid)
        {
            Api_Result <MissionResultFmt> api_Result = new Api_Result <MissionResultFmt>();
            Mem_deck mem_deck = null;

            if (!Comm_UserDatas.Instance.User_deck.TryGetValue(deck_rid, ref mem_deck))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (mem_deck.MissionState != MissionStates.END && mem_deck.MissionState != MissionStates.STOP)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (mem_deck.Ship.Count() == 0)
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            if (this.mst_level == null)
            {
                this.mst_level = Mst_DataManager.Instance.Get_MstLevel(true);
            }
            if (this.mst_userlevel == null)
            {
                this.mst_userlevel = Mst_DataManager.Instance.Get_MstLevel(false);
            }
            int  mission_id = mem_deck.Mission_id;
            bool flag       = mem_deck.MissionState == MissionStates.STOP;
            Exec_MissionResult exec_MissionResult = new Exec_MissionResult(mem_deck, this.mst_level, this.mst_userlevel);

            api_Result.data = exec_MissionResult.GetResultData();
            if (!flag)
            {
                QuestMission questMission = new QuestMission(mission_id, mem_deck, api_Result.data.MissionResult);
                questMission.ExecuteCheck();
            }
            return(api_Result);
        }