Exemplo n.º 1
0
        public override Api_Result <BattleResultFmt> BattleResult()
        {
            Api_Result <BattleResultFmt> api_Result = base.BattleResult();
            int count = userData.StartHp.Count;

            for (int i = 0; i < count; i++)
            {
                userData.ShipData[i].SetHp(this, userData.StartHp[i]);
            }
            if (api_Result.state == Api_Result_State.Parameter_Error)
            {
                return(api_Result);
            }
            Dictionary <int, int> slotExpBattleData = GetSlotExpBattleData();

            foreach (KeyValuePair <int, int> item in slotExpBattleData)
            {
                Mem_slotitem value = null;
                if (Comm_UserDatas.Instance.User_slot.TryGetValue(item.Key, out value))
                {
                    value.ChangeExperience(item.Value);
                }
            }
            QuestPractice questPractice = new QuestPractice(api_Result.data);

            questPractice.ExecuteCheck();
            return(api_Result);
        }
Exemplo n.º 2
0
        public override Api_Result <BattleResultFmt> BattleResult()
        {
            Api_Result <BattleResultFmt> api_Result = base.BattleResult();
            int count = this.userData.StartHp.get_Count();

            for (int i = 0; i < count; i++)
            {
                this.userData.ShipData.get_Item(i).SetHp(this, this.userData.StartHp.get_Item(i));
            }
            if (api_Result.state == Api_Result_State.Parameter_Error)
            {
                return(api_Result);
            }
            Dictionary <int, int> slotExpBattleData = base.GetSlotExpBattleData();

            using (Dictionary <int, int> .Enumerator enumerator = slotExpBattleData.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair <int, int> current      = enumerator.get_Current();
                    Mem_slotitem            mem_slotitem = null;
                    if (Comm_UserDatas.Instance.User_slot.TryGetValue(current.get_Key(), ref mem_slotitem))
                    {
                        mem_slotitem.ChangeExperience(current.get_Value());
                    }
                }
            }
            QuestPractice questPractice = new QuestPractice(api_Result.data);

            questPractice.ExecuteCheck();
            return(api_Result);
        }
Exemplo n.º 3
0
        public Api_Result <PracticeDeckResultFmt> GetResultData(DeckPracticeType type, int deck_rid)
        {
            Api_Result <PracticeDeckResultFmt> api_Result = new Api_Result <PracticeDeckResultFmt>();

            if (!Comm_UserDatas.Instance.User_deck.TryGetValue(deck_rid, out mem_deck))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            mem_ship = mem_deck.Ship.getMemShip();
            PracticeDeckResultFmt practiceDeckResultFmt = new PracticeDeckResultFmt();

            practiceDeckResultFmt.PracticeResult.Deck      = mem_deck;
            practiceDeckResultFmt.PracticeResult.GetSpoint = 0;
            if (execFunc == null)
            {
                execFunc = new Dictionary <DeckPracticeType, Action <PracticeDeckResultFmt> >
                {
                    {
                        DeckPracticeType.Normal,
                        getPracticeUpInfo_To_Normal
                    },
                    {
                        DeckPracticeType.Hou,
                        getPracticeUpInfo_To_Houg
                    },
                    {
                        DeckPracticeType.Rai,
                        getPracticeUpInfo_To_Raig
                    },
                    {
                        DeckPracticeType.Taisen,
                        getPracticeUpInfo_To_Taisen
                    },
                    {
                        DeckPracticeType.Kouku,
                        getPracticeUpInfo_To_Kouku
                    },
                    {
                        DeckPracticeType.Sougou,
                        getPracticeUpInfo_To_Sougou
                    }
                };
            }
            execFunc[type](practiceDeckResultFmt);
            practiceDeckResultFmt.PracticeResult.MemberLevel = updateRecordLevel(practiceDeckResultFmt.PracticeResult.GetMemberExp);
            practiceDeckResultFmt.PracticeResult.LevelUpInfo = updateShip(type, practiceDeckResultFmt.PracticeResult.GetShipExp, practiceDeckResultFmt.PowerUpData);
            api_Result.data = practiceDeckResultFmt;
            mem_deck.ActionEnd();
            QuestPractice questPractice = new QuestPractice(type, practiceDeckResultFmt);

            questPractice.ExecuteCheck();
            Comm_UserDatas.Instance.User_record.UpdatePracticeCount(BattleWinRankKinds.NONE, practiceBattle: false);
            return(api_Result);
        }
Exemplo n.º 4
0
        public Api_Result <PracticeDeckResultFmt> GetResultData(DeckPracticeType type, int deck_rid)
        {
            Api_Result <PracticeDeckResultFmt> api_Result = new Api_Result <PracticeDeckResultFmt>();

            if (!Comm_UserDatas.Instance.User_deck.TryGetValue(deck_rid, ref this.mem_deck))
            {
                api_Result.state = Api_Result_State.Parameter_Error;
                return(api_Result);
            }
            this.mem_ship = this.mem_deck.Ship.getMemShip();
            PracticeDeckResultFmt practiceDeckResultFmt = new PracticeDeckResultFmt();

            practiceDeckResultFmt.PracticeResult.Deck      = this.mem_deck;
            practiceDeckResultFmt.PracticeResult.GetSpoint = 0;
            if (this.execFunc == null)
            {
                Dictionary <DeckPracticeType, Action <PracticeDeckResultFmt> > dictionary = new Dictionary <DeckPracticeType, Action <PracticeDeckResultFmt> >();
                dictionary.Add(DeckPracticeType.Normal, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Normal));
                dictionary.Add(DeckPracticeType.Hou, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Houg));
                dictionary.Add(DeckPracticeType.Rai, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Raig));
                dictionary.Add(DeckPracticeType.Taisen, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Taisen));
                dictionary.Add(DeckPracticeType.Kouku, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Kouku));
                dictionary.Add(DeckPracticeType.Sougou, new Action <PracticeDeckResultFmt>(this.getPracticeUpInfo_To_Sougou));
                this.execFunc = dictionary;
            }
            this.execFunc.get_Item(type).Invoke(practiceDeckResultFmt);
            practiceDeckResultFmt.PracticeResult.MemberLevel = this.updateRecordLevel(practiceDeckResultFmt.PracticeResult.GetMemberExp);
            practiceDeckResultFmt.PracticeResult.LevelUpInfo = this.updateShip(type, practiceDeckResultFmt.PracticeResult.GetShipExp, practiceDeckResultFmt.PowerUpData);
            api_Result.data = practiceDeckResultFmt;
            this.mem_deck.ActionEnd();
            QuestPractice questPractice = new QuestPractice(type, practiceDeckResultFmt);

            questPractice.ExecuteCheck();
            Comm_UserDatas.Instance.User_record.UpdatePracticeCount(BattleWinRankKinds.NONE, false);
            return(api_Result);
        }