public static T[] AddElement <T>(T[] elements, T element)
        {
            ListView <T> inList = new ListView <T>(elements);

            inList.Add(element);
            return(LinqS.ToArray <T>(inList));
        }
Beispiel #2
0
 public void Parse(string InText)
 {
     this.text     = InText;
     this.sections = Regex.Split(this.text, RegexPattern);
     for (int i = 0; i < this.sections.Length; i++)
     {
         char[] trimChars = new char[] { '"' };
         this.sections[i] = this.sections[i].Trim(trimChars);
     }
     if (this.sections.Length > 0)
     {
         this.baseCommand = this.sections[0];
     }
     else
     {
         this.baseCommand = string.Empty;
     }
     if (this.sections.Length > 1)
     {
         this.arguments = LinqS.Skip(this.sections, 1);
     }
     else
     {
         this.arguments = null;
     }
 }
Beispiel #3
0
        private void OnAchievementOpenAwardForm(CUIEvent uiEvent)
        {
            uint           tagUInt   = uiEvent.m_eventParams.tagUInt;
            ResAchievement dataByKey = GameDataMgr.achieveDatabin.GetDataByKey(tagUInt);

            if (dataByKey != null)
            {
                ListView <CUseable> inList = new ListView <CUseable>();
                CUseable            item   = CUseableManager.CreateVirtualUseable(enVirtualItemType.enAchievementPoint, (int)dataByKey.dwPoint);
                inList.Add(item);
                for (int i = 0; i < dataByKey.astReward.Length; i++)
                {
                    if ((dataByKey.astReward[i].bRewardType != 0) && (dataByKey.astReward[i].dwRewardNum > 0))
                    {
                        CUseable useable2 = CUseableManager.CreateUsableByServerType((RES_REWARDS_TYPE)dataByKey.astReward[i].bRewardType, (int)dataByKey.astReward[i].dwRewardNum, dataByKey.astReward[i].dwRewardID);
                        if (useable2 != null)
                        {
                            inList.Add(useable2);
                        }
                    }
                }
                if (inList.Count > 0)
                {
                    Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(inList), Singleton <CTextManager> .GetInstance().GetText("Achievement_Get_Award_Success"), false, enUIEventID.None, false, false, "Form_Award");
                }
            }
        }
 public static T[] AddElement <T>(T[] elements, T element)
 {
     return(LinqS.ToArray <T>(new ListView <T>(elements)
     {
         element
     }));
 }
        public static T[] AddElement <T>(T[] elements, T element)
        {
            ListView <T> listView = new ListView <T>(elements);

            listView.Add(element);
            return(LinqS.ToArray <T>(listView));
        }
 private void OnClickGetNewHeroPanel(CUIEvent uiEvent)
 {
     if (this.rewardItems != null && this.rewardItems.Count > 0)
     {
         Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(this.rewardItems), null, false, enUIEventID.None, false, false, "Form_Award");
     }
 }
Beispiel #7
0
        public void Parse(string InText)
        {
            text = InText;

            sections = Regex.Split(text, RegexPattern);

            // sections = sections.Where(x => !string.IsNullOrEmpty(x.Trim())).ToArray();

            for (int i = 0; i < sections.Length; ++i)
            {
                sections[i] = sections[i].Trim('"');
            }

            if (sections.Length > 0)
            {
                baseCommand = sections[0];
            }
            else
            {
                baseCommand = "";
            }

            if (sections.Length > 1)
            {
                arguments = LinqS.Skip(sections, 1);
            }
            else
            {
                arguments = null;
            }
        }
Beispiel #8
0
    private static Texture[] PreloadTexture(GameObject tarObj, List <GameObject> parentPrefabList)
    {
        if (!IsSafe())
        {
            return(null);
        }
        Renderer[]         componentsInChildren = tarObj.GetComponentsInChildren <Renderer>(true);
        ListView <Texture> inList = new ListView <Texture>();

        foreach (Renderer renderer in componentsInChildren)
        {
            if ((renderer.sharedMaterials != null) && (renderer.sharedMaterials.Length > 0))
            {
                foreach (Material material in renderer.sharedMaterials)
                {
                    if ((material != null) && (material.mainTexture != null))
                    {
                        inList.Add(material.mainTexture);
                    }
                }
            }
        }
        foreach (NcSpriteTexture texture in tarObj.GetComponentsInChildren <NcSpriteTexture>(true))
        {
            if (texture.m_NcSpriteFactoryPrefab != null)
            {
                Texture[] collection = PreloadPrefab(texture.m_NcSpriteFactoryPrefab, parentPrefabList, false);
                if (collection != null)
                {
                    inList.AddRange(collection);
                }
            }
        }
        foreach (NcSpriteFactory factory in tarObj.GetComponentsInChildren <NcSpriteFactory>(true))
        {
            if (factory.m_SpriteList != null)
            {
                for (int i = 0; i < factory.m_SpriteList.Count; i++)
                {
                    if (factory.m_SpriteList[i].m_EffectPrefab != null)
                    {
                        Texture[] textureArray4 = PreloadPrefab(factory.m_SpriteList[i].m_EffectPrefab, parentPrefabList, true);
                        if (textureArray4 == null)
                        {
                            factory.m_SpriteList[i].m_EffectPrefab = null;
                        }
                        else
                        {
                            inList.AddRange(textureArray4);
                        }
                        if (factory.m_SpriteList[i].m_AudioClip != null)
                        {
                        }
                    }
                }
            }
        }
        return(LinqS.ToArray <Texture>(inList));
    }
Beispiel #9
0
        public static void OnReceiveDianQuanReward(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_COUPONS_REWARDINFO stCouponsRewardRsp = msg.stPkgData.stCouponsRewardRsp;
            bool       flag     = true;
            CPaySystem instance = Singleton <CPaySystem> .GetInstance();

            instance.rewardItems.Clear();
            int num = Mathf.Min(stCouponsRewardRsp.stRewardInfo.bNum, stCouponsRewardRsp.stRewardInfo.astRewardDetail.Length);

            for (int i = 0; i < num; i++)
            {
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 5)
                {
                    CUICommonSystem.ShowNewHeroOrSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stHero.dwHeroID, 0, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, false, null, enFormPriority.Priority1, 0, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 10)
                {
                    uint num3;
                    uint num4;
                    CSkinInfo.ResolveHeroSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stSkin.dwSkinID, out num3, out num4);
                    CUICommonSystem.ShowNewHeroOrSkin(num3, num4, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, false, null, enFormPriority.Priority1, 0, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 1)
                {
                    if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 1)
                    {
                        uint           dwHeroID  = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stHeroInfo.dwHeroID;
                        ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(dwHeroID);
                        if (dataByKey != null)
                        {
                            CUICommonSystem.ShowNewHeroOrSkin(dwHeroID, 0, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, dataByKey.dwChgItemCnt, 0);
                        }
                    }
                    else if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 2)
                    {
                        uint dwSkinID = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stSkinInfo.dwSkinID;
                        uint heroId   = 0;
                        uint skinId   = 0;
                        CSkinInfo.ResolveHeroSkin(dwSkinID, out heroId, out skinId);
                        ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId);
                        if (heroSkin != null)
                        {
                            CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, heroSkin.dwChgItemCnt, 0);
                        }
                    }
                }
            }
            instance.rewardItems = CUseableManager.GetUseableListFromReward(stCouponsRewardRsp.stRewardInfo);
            if (flag)
            {
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(instance.rewardItems), null, false, enUIEventID.None, false, false, "Form_Award");
            }
        }
 public DependencyDescription(int InIndex, string InValue)
 {
     this.dependsIndex = InIndex;
     this.Dpendencies  = LinqS.Where(InValue.Split(new char[]
     {
         '|'
     }), (string x) => !string.IsNullOrEmpty(x.Trim()));
 }
Beispiel #11
0
 public static T[] AppendElements<T>(T[] elements, T[] appendElements)
 {
     ListView<T> inList = new ListView<T>(elements);
     if (appendElements != null)
     {
         inList.AddRange(appendElements);
     }
     return LinqS.ToArray<T>(inList);
 }
        public static T[] AppendElements <T>(T[] elements, T[] appendElements)
        {
            ListView <T> listView = new ListView <T>(elements);

            if (appendElements != null)
            {
                listView.AddRange(appendElements);
            }
            return(LinqS.ToArray <T>(listView));
        }
Beispiel #13
0
        public static void SendItemSaleMsg(ListView <CSDT_ITEM_DELINFO> itemList)
        {
            CSPkg             msg = NetworkModule.CreateDefaultCSPKG(0x44d);
            CSDT_ITEM_DELLIST csdt_item_dellist = new CSDT_ITEM_DELLIST {
                wItemCnt    = (ushort)itemList.Count,
                astItemList = LinqS.ToArray <CSDT_ITEM_DELINFO>(itemList)
            };

            msg.stPkgData.stItemSale.stSaleList = csdt_item_dellist;
            Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, true);
        }
        public void OnHuoyue_Reward_RES(ref CSPkg pkg)
        {
            SCPKG_GETHUOYUEDUREWARD_RSP stHuoYueDuRewardRsp = pkg.stPkgData.stHuoYueDuRewardRsp;

            this.model.huoyue_data.Get_Reward((RES_HUOYUEDU_TYPE)stHuoYueDuRewardRsp.bRewardType, stHuoYueDuRewardRsp.wHuoYueDuId);
            if (stHuoYueDuRewardRsp.stRewardInfo.bNum > 0)
            {
                ListView <CUseable> useableListFromReward = CUseableManager.GetUseableListFromReward(stHuoYueDuRewardRsp.stRewardInfo);
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(useableListFromReward), null, false, enUIEventID.None, false, false, "Form_Award");
            }
            if (this.m_taskView != null)
            {
                this.m_taskView.Refresh_Huoyue();
            }
        }
Beispiel #15
0
        public override bool HandleAutoComplete()
        {
            if (CandinatesList.hasValidSelection)
            {
                var Selection = CandinatesList.SelectedName;

                string[] SplitedParts = LinqS.Where(Selection.Split(' '), x => !string.IsNullOrEmpty(x.Trim()));

                if (SplitedParts != null && SplitedParts.Length > 0)
                {
                    inputText = SplitedParts[0];
                    return(true);
                }
            }

            return(false);
        }
Beispiel #16
0
        public static void OnSCID_GETPVPLEVELREWARD_RSP(CSPkg pkg)
        {
            SCPKG_GETPVPLEVELREWARD_RSP stLevelRewardRsp = pkg.stPkgData.get_stLevelRewardRsp();

            if (stLevelRewardRsp.iErrorCode == 0)
            {
                Singleton <CTaskSys> .get_instance().model.SyncServerLevelRewardFlagData(stLevelRewardRsp.ullLevelRewardFlag);

                ListView <CUseable> useableListFromReward = CUseableManager.GetUseableListFromReward(stLevelRewardRsp.stRewardInfo);
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(useableListFromReward), null, false, enUIEventID.None, false, false, "Form_Award");

                Singleton <CTaskSys> .get_instance().m_taskView.Refresh();
            }
            else
            {
                Debug.LogError("---领取等级奖励 response error, errorcode:" + stLevelRewardRsp.iErrorCode);
            }
        }
Beispiel #17
0
 public CheatCommandName(string InName)
 {
     DebugHelper.Assert(!string.IsNullOrEmpty(InName));
     this.rawName = InName;
     char[]   separator     = new char[] { '/' };
     string[] inStringArray = InName.Split(separator);
     if ((inStringArray != null) && (inStringArray.Length > 1))
     {
         this.baseName         = inStringArray[inStringArray.Length - 1];
         this.groupName        = inStringArray[inStringArray.Length - 2];
         this.groupHierarchies = LinqS.Take(inStringArray, inStringArray.Length - 1);
     }
     else
     {
         this.baseName         = InName;
         this.groupName        = "通用";
         this.groupHierarchies = new string[] { this.groupName };
     }
 }
Beispiel #18
0
 public bool FilterMatch(ref PoolObjHandle <ActorRoot> inActor)
 {
     if (inActor == 0)
     {
         return(false);
     }
     if (((this.ActorType != null) && (this.ActorType.Length > 0)) && !LinqS.Contains <ActorTypeDef>(this.ActorType, inActor.handle.TheActorMeta.ActorType))
     {
         return(false);
     }
     if (((this.ConfigID != null) && (this.ConfigID.Length > 0)) && !LinqS.Contains <int>(this.ConfigID, inActor.handle.TheActorMeta.ConfigId))
     {
         return(false);
     }
     if (((this.CmpType != null) && (this.CmpType.Length > 0)) && !LinqS.Contains <COM_PLAYERCAMP>(this.CmpType, inActor.handle.TheActorMeta.ActorCamp))
     {
         return(false);
     }
     return(true);
 }
Beispiel #19
0
        public CheatCommandName(string InName)
        {
            DebugHelper.Assert(!string.IsNullOrEmpty(InName));

            rawName = InName;

            string[] SplitedResults = InName.Split('/');

            if (SplitedResults != null && SplitedResults.Length > 1)
            {
                baseName         = SplitedResults[SplitedResults.Length - 1];
                groupName        = SplitedResults[SplitedResults.Length - 2];
                groupHierarchies = LinqS.Take(SplitedResults, SplitedResults.Length - 1);
            }
            else
            {
                baseName         = InName;
                groupName        = @"Gernal";
                groupHierarchies = new string[] { groupName };
            }
        }
Beispiel #20
0
        public static void ShowSeasonEndGetRewardForm(byte grade)
        {
            ResRankRewardConf dataByKey = GameDataMgr.rankRewardDatabin.GetDataByKey((uint)grade);

            if (dataByKey != null)
            {
                ListView <CUseable> listView = new ListView <CUseable>();
                for (int i = 0; i < dataByKey.astRewardDetail.Length; i++)
                {
                    ResDT_ChapterRewardInfo resDT_ChapterRewardInfo = dataByKey.astRewardDetail[i];
                    if (resDT_ChapterRewardInfo.bType != 0)
                    {
                        CUseable cUseable = CUseableManager.CreateUsableByServerType((RES_REWARDS_TYPE)resDT_ChapterRewardInfo.bType, (int)resDT_ChapterRewardInfo.dwNum, resDT_ChapterRewardInfo.dwID);
                        if (cUseable != null)
                        {
                            listView.Add(cUseable);
                        }
                    }
                }
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(listView), Singleton <CTextManager> .GetInstance().GetText("Ladder_Season_Reward"), false, enUIEventID.Ladder_ReqGetSeasonReward, false, false, "Form_Award");
            }
        }
Beispiel #21
0
        protected virtual void EquipWeapon(CharacterLogic target)
        {
            var weapons = logic.Info.Items.GetAllWeapons();

            if (weapons.Count <= 1)
            {
                return;
            }
            List <WeaponItem> avWeapons = new List <WeaponItem>();

            foreach (var v in weapons)
            {
                //找到每个武器可以攻击到的范围内的敌方单位

                var rangeType = v.GetDefinition().RangeType;
                EnumSelectEffectRangeType selRangeType = rangeType.SelectType;
                Vector2Int selRange = rangeType.SelectRange;
                EnumSelectEffectRangeType effRangeType = rangeType.EffectType;
                Vector2Int effRange = rangeType.EffectRange;
                logic.BattleInfo.SetSelectTargetParam(CharacterBattleInfo.EBattleActionType.Attack, logic.GetTileCoord(), selRangeType, selRange, effRangeType, effRange);
                if (logic.BattleInfo.TargetChooseRanges.Contains(target.GetTileCoord()))
                {
                    avWeapons.Add(v);
                }
            }
            List <int> damage = new List <int>();

            //根据对方的属性选择伤害最高的武器
            foreach (var v in weapons)
            {
                logic.Info.Items.EquipWeapon(v);
                int dmg = BattleLogic.GetAttackCount(logic, target) * BattleLogic.GetAttackDamage(logic, target);
                damage.Add(dmg);
            }
            int maxDamageIndex = LinqS.IndexOfMax(damage.GetEnumerator());

            logic.Info.Items.EquipWeapon(avWeapons[maxDamageIndex]);
        }
Beispiel #22
0
        private void On_GET_BURNING_REWARD_RSP(CSPkg msg)
        {
            SCPKG_GET_BURNING_REWARD_RSP stGetBurningRewardRsp = msg.stPkgData.get_stGetBurningRewardRsp();

            if (stGetBurningRewardRsp.iErrCode == 0)
            {
                if (stGetBurningRewardRsp.stRewardDetail.get_stOfSucc().bNextLevelNo != 0)
                {
                    this.model.Set_ENEMY_TEAM_INFO(this.model.curDifficultyType, (int)(stGetBurningRewardRsp.stRewardDetail.get_stOfSucc().bNextLevelNo - 1), stGetBurningRewardRsp.stRewardDetail.get_stOfSucc().stNextEnemyInfo);
                }
                ListView <CUseable> useableListFromReward = CUseableManager.GetUseableListFromReward(stGetBurningRewardRsp.stRewardDetail.get_stOfSucc().stReward);
                for (int i = 0; i < useableListFromReward.get_Count(); i++)
                {
                    useableListFromReward.get_Item(i).SetMultiple(ref stGetBurningRewardRsp.stRewardDetail.get_stOfSucc().stMultipleDetail, true);
                }
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(useableListFromReward), null, false, enUIEventID.None, false, false, "Form_Award");

                this.model.FinishBox(this.model.curSelect_BoxIndex);
                if (this.model.curSelect_BoxIndex <= BurnExpeditionController.Max_Level_Index - 1)
                {
                    this.model.UnLockLevel(this.model.curSelect_BoxIndex + 1);
                    if (this.view != null)
                    {
                        this.view.Show_Line(this.model.curSelect_BoxIndex + 1);
                    }
                }
                this.model.CalcProgress();
                if (this.view != null)
                {
                    this.view.Show_Map();
                }
            }
            else if (stGetBurningRewardRsp.iErrCode != 12)
            {
                Singleton <CUIManager> .GetInstance().OpenMessageBox(string.Format(UT.GetText("Burn_Error_GetAward"), stGetBurningRewardRsp.iErrCode), false);
            }
        }
Beispiel #23
0
        public void UpdateCandinates()
        {
            var InputText = inputText;

            string[] SplitedParts = LinqS.Where(InputText.Split(' '), x => !string.IsNullOrEmpty(x.Trim()));

            List <IListItem> Candinates = new List <IListItem>();

            if (SplitedParts == null || SplitedParts.Length <= 0)
            {
                // no any valid input.
                var GeneralRepositories = CheatCommandsRepository.instance.generalRepositories;

                var Iter = GeneralRepositories.Commands.GetEnumerator();

                while (Iter.MoveNext())
                {
                    Candinates.Add(new CheatCommandItem(Iter.Current.Value));
                }

                CandinatesList.Reset(Candinates);
            }
            else
            {
                var BaseCommand = SplitedParts[0];

                var FilteredCommands = CheatCommandsRepository.instance.FilterByString(BaseCommand);

                for (int i = 0; i < FilteredCommands.Count; ++i)
                {
                    Candinates.Add(new CheatCommandItem(FilteredCommands[i]));
                }

                CandinatesList.Reset(Candinates);
            }
        }
Beispiel #24
0
 public CheatCommandName(string InName)
 {
     DebugHelper.Assert(!string.IsNullOrEmpty(InName));
     this.rawName = InName;
     string[] array = InName.Split(new char[]
     {
         '/'
     });
     if (array != null && array.Length > 1)
     {
         this.baseName         = array[array.Length - 1];
         this.groupName        = array[array.Length - 2];
         this.groupHierarchies = LinqS.Take(array, array.Length - 1);
     }
     else
     {
         this.baseName         = InName;
         this.groupName        = "通用";
         this.groupHierarchies = new string[]
         {
             this.groupName
         };
     }
 }
Beispiel #25
0
        public DependencyDescription(int InIndex, string InValue)
        {
            dependsIndex = InIndex;

            Dpendencies = LinqS.Where(InValue.Split('|'), x => !string.IsNullOrEmpty(x.Trim()));
        }
Beispiel #26
0
        public static void OnReceiveDianQuanReward(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_COUPONS_REWARDINFO stCouponsRewardRsp = msg.stPkgData.get_stCouponsRewardRsp();
            bool       flag     = true;
            CPaySystem instance = Singleton <CPaySystem> .GetInstance();

            instance.rewardItems.Clear();
            int num = Mathf.Min((int)stCouponsRewardRsp.stRewardInfo.bNum, stCouponsRewardRsp.stRewardInfo.astRewardDetail.Length);

            for (int i = 0; i < num; i++)
            {
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 5)
                {
                    CUICommonSystem.ShowNewHeroOrSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.get_stHero().dwHeroID, 0u, enUIEventID.Pay_ClickGetNewHeroPanel, true, 5, false, null, enFormPriority.Priority1, 0u, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 10)
                {
                    uint heroId;
                    uint skinId;
                    CSkinInfo.ResolveHeroSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.get_stSkin().dwSkinID, out heroId, out skinId);
                    CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.Pay_ClickGetNewHeroPanel, true, 10, false, null, enFormPriority.Priority1, 0u, 0);
                    flag = false;
                    break;
                }
                if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 1)
                {
                    if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 1)
                    {
                        uint           dwHeroID  = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.get_stHeroInfo().dwHeroID;
                        ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(dwHeroID);
                        if (dataByKey != null)
                        {
                            ResHeroShop resHeroShop = null;
                            GameDataMgr.heroShopInfoDict.TryGetValue(dataByKey.dwCfgID, ref resHeroShop);
                            CUICommonSystem.ShowNewHeroOrSkin(dwHeroID, 0u, enUIEventID.Pay_ClickGetNewHeroPanel, true, 5, true, null, enFormPriority.Priority1, (resHeroShop == null) ? 1u : resHeroShop.dwChgItemCnt, 0);
                        }
                    }
                    else if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 2)
                    {
                        uint dwSkinID = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.get_stSkinInfo().dwSkinID;
                        uint heroId2  = 0u;
                        uint skinId2  = 0u;
                        CSkinInfo.ResolveHeroSkin(dwSkinID, out heroId2, out skinId2);
                        ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId2, skinId2);
                        if (heroSkin != null)
                        {
                            ResHeroSkinShop resHeroSkinShop = null;
                            GameDataMgr.skinShopInfoDict.TryGetValue(heroSkin.dwID, ref resHeroSkinShop);
                            CUICommonSystem.ShowNewHeroOrSkin(heroId2, skinId2, enUIEventID.Pay_ClickGetNewHeroPanel, true, 5, true, null, enFormPriority.Priority1, (resHeroSkinShop == null) ? 1u : resHeroSkinShop.dwChgItemCnt, 0);
                        }
                    }
                }
            }
            instance.rewardItems = CUseableManager.GetUseableListFromReward(stCouponsRewardRsp.stRewardInfo);
            if (flag)
            {
                Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(instance.rewardItems), null, false, enUIEventID.None, false, false, "Form_Award");
            }
        }
Beispiel #27
0
        public void CalculateKDA(COMDT_GAME_INFO gameInfo)
        {
            CRoleInfo masterRoleInfo = this.GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "masterRoleInfo is null");
            if (masterRoleInfo != null)
            {
                PlayerKDA hostKDA = Singleton <BattleStatistic> .GetInstance().m_playerKDAStat.GetHostKDA();

                if (hostKDA != null)
                {
                    int num   = 0;
                    int num2  = 0;
                    int num3  = 0;
                    int num4  = 0;
                    int num5  = 0;
                    int num6  = 0;
                    int num7  = 0;
                    int num8  = 0;
                    int num9  = 0;
                    int num10 = 0;
                    int num11 = 0;
                    int num12 = 0;
                    ListView <HeroKDA> .Enumerator enumerator = hostKDA.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        if (enumerator.Current != null)
                        {
                            num   += enumerator.Current.LegendaryNum;
                            num2  += enumerator.Current.PentaKillNum;
                            num3  += enumerator.Current.QuataryKillNum;
                            num4  += enumerator.Current.TripleKillNum;
                            num5  += enumerator.Current.DoubleKillNum;
                            num8  += !enumerator.Current.bHurtMost ? 0 : 1;
                            num9  += !enumerator.Current.bHurtTakenMost ? 0 : 1;
                            num10 += !enumerator.Current.bGetCoinMost ? 0 : 1;
                            num11 += !enumerator.Current.bAsssistMost ? 0 : 1;
                            num12 += !enumerator.Current.bKillMost ? 0 : 1;
                        }
                    }
                    if (gameInfo.bGameResult == 1)
                    {
                        uint mvpPlayer = Singleton <BattleStatistic> .instance.GetMvpPlayer(hostKDA.PlayerCamp, true);

                        if (mvpPlayer != 0)
                        {
                            num6 = (mvpPlayer != hostKDA.PlayerId) ? 0 : 1;
                        }
                    }
                    else if (gameInfo.bGameResult == 2)
                    {
                        uint num14 = Singleton <BattleStatistic> .instance.GetMvpPlayer(hostKDA.PlayerCamp, false);

                        if (num14 != 0)
                        {
                            num7 = (num14 != hostKDA.PlayerId) ? 0 : 1;
                        }
                    }
                    bool flag   = false;
                    bool flag2  = false;
                    bool flag3  = false;
                    bool flag4  = false;
                    bool flag5  = false;
                    bool flag6  = false;
                    bool flag7  = false;
                    bool flag8  = false;
                    bool flag9  = false;
                    bool flag10 = false;
                    bool flag11 = false;
                    bool flag12 = false;
                    int  index  = 0;
                    ListView <COMDT_STATISTIC_KEY_VALUE_INFO> inList = new ListView <COMDT_STATISTIC_KEY_VALUE_INFO>();
                    while (index < masterRoleInfo.pvpDetail.stKVDetail.dwNum)
                    {
                        COMDT_STATISTIC_KEY_VALUE_INFO comdt_statistic_key_value_info = masterRoleInfo.pvpDetail.stKVDetail.astKVDetail[index];
                        switch (comdt_statistic_key_value_info.dwKey)
                        {
                        case 13:
                            comdt_statistic_key_value_info.dwValue += (uint)num6;
                            flag6 = true;
                            break;

                        case 14:
                            comdt_statistic_key_value_info.dwValue += (uint)num7;
                            flag7 = true;
                            break;

                        case 15:
                            comdt_statistic_key_value_info.dwValue += (uint)num;
                            flag5 = true;
                            break;

                        case 0x10:
                            comdt_statistic_key_value_info.dwValue += (uint)num5;
                            flag = true;
                            break;

                        case 0x11:
                            comdt_statistic_key_value_info.dwValue += (uint)num4;
                            flag2 = true;
                            break;

                        case 0x1b:
                            comdt_statistic_key_value_info.dwValue += (uint)num3;
                            flag3 = true;
                            break;

                        case 0x1c:
                            comdt_statistic_key_value_info.dwValue += (uint)num2;
                            flag4 = true;
                            break;

                        case 0x1d:
                            comdt_statistic_key_value_info.dwValue += (uint)num8;
                            flag8 = true;
                            break;

                        case 30:
                            comdt_statistic_key_value_info.dwValue += (uint)num10;
                            flag10 = true;
                            break;

                        case 0x1f:
                            comdt_statistic_key_value_info.dwValue += (uint)num9;
                            flag9 = true;
                            break;

                        case 0x20:
                            comdt_statistic_key_value_info.dwValue += (uint)num11;
                            flag11 = true;
                            break;

                        case 0x21:
                            comdt_statistic_key_value_info.dwValue += (uint)num12;
                            flag12 = true;
                            break;
                        }
                        index++;
                    }
                    COMDT_STATISTIC_KEY_VALUE_INFO item = null;
                    if (!flag)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x10,
                            dwValue = (uint)num5
                        };
                        inList.Add(item);
                    }
                    if (!flag2)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x11,
                            dwValue = (uint)num4
                        };
                        inList.Add(item);
                    }
                    if (!flag3)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x1b,
                            dwValue = (uint)num3
                        };
                        inList.Add(item);
                    }
                    if (!flag4)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x1c,
                            dwValue = (uint)num2
                        };
                        inList.Add(item);
                    }
                    if (!flag5)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 15,
                            dwValue = (uint)num
                        };
                        inList.Add(item);
                    }
                    if (!flag6)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 13,
                            dwValue = (uint)num6
                        };
                        inList.Add(item);
                    }
                    if (!flag7)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 14,
                            dwValue = (uint)num7
                        };
                        inList.Add(item);
                    }
                    if (!flag8)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x1d,
                            dwValue = (uint)num8
                        };
                        inList.Add(item);
                    }
                    if (!flag9)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x1f,
                            dwValue = (uint)num9
                        };
                        inList.Add(item);
                    }
                    if (!flag10)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 30,
                            dwValue = (uint)num10
                        };
                        inList.Add(item);
                    }
                    if (!flag11)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x20,
                            dwValue = (uint)num11
                        };
                        inList.Add(item);
                    }
                    if (!flag12)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x21,
                            dwValue = (uint)num12
                        };
                        inList.Add(item);
                    }
                    if (inList.Count > 0)
                    {
                        masterRoleInfo.pvpDetail.stKVDetail.dwNum += (uint)inList.Count;
                        inList.AddRange(masterRoleInfo.pvpDetail.stKVDetail.astKVDetail);
                        masterRoleInfo.pvpDetail.stKVDetail.astKVDetail = LinqS.ToArray <COMDT_STATISTIC_KEY_VALUE_INFO>(inList);
                    }
                }
            }
        }
Beispiel #28
0
        public List <string> GetCandinates(Type InType)
        {
            string[] Results = Enum.GetNames(InType);

            return(Results != null?LinqS.ToStringList(Results) : null);
        }
Beispiel #29
0
        private void ShowNextReward(CUIEvent firstIfNull)
        {
            if ((firstIfNull != null) || ((this._rewardShowList == null) && (this._rewardQueueIndex <= -1)))
            {
                if (this._rewardShowList == null)
                {
                    this._rewardQueueIndex++;
                    if (this._rewardQueueIndex >= this._rewardListQueue.Count)
                    {
                        Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Common_NewHeroOrSkinFormClose, new CUIEventManager.OnUIEventHandler(this.ShowNextReward));

                        Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Mall_Get_AWARD_CLOSE_FORM, new CUIEventManager.OnUIEventHandler(this.ShowNextReward));

                        this._rewardListQueue.Clear();
                        this._rewardQueueIndex = -1;
                        this._rewardShowIndex  = -1;
                        return;
                    }
                    this._rewardShowList   = this._rewardListQueue[this._rewardQueueIndex];
                    this._rewardShowIndex  = -1;
                    this._rewardHasSpecial = false;
                }
                while ((((++this._rewardShowIndex < this._rewardShowList.usabList.Count) && (this._rewardShowList.usabList[this._rewardShowIndex].MapRewardType != COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO)) && (this._rewardShowList.usabList[this._rewardShowIndex].MapRewardType != COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN)) && ((this._rewardShowList.usabList[this._rewardShowIndex].MapRewardType != COM_REWARDS_TYPE.COM_REWARDS_TYPE_ITEM) || ((this._rewardShowList.usabList[this._rewardShowIndex].ExtraFromType != 1) && (this._rewardShowList.usabList[this._rewardShowIndex].ExtraFromType != 2))))
                {
                }
                if (this._rewardShowIndex < this._rewardShowList.usabList.Count)
                {
                    CUseable useable = this._rewardShowList.usabList[this._rewardShowIndex];
                    if (useable.MapRewardType == COM_REWARDS_TYPE.COM_REWARDS_TYPE_ITEM)
                    {
                        if (useable.ExtraFromType == 1)
                        {
                            CUICommonSystem.ShowNewHeroOrSkin((uint)useable.ExtraFromData, 0, enUIEventID.None, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, (uint)useable.m_stackCount, 0);
                        }
                        else if (useable.ExtraFromType == 2)
                        {
                            int extraFromData = useable.ExtraFromData;
                            CUICommonSystem.ShowNewHeroOrSkin(0, (uint)extraFromData, enUIEventID.None, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, true, null, enFormPriority.Priority1, (uint)useable.m_stackCount, 0);
                        }
                    }
                    else if (useable is CHeroSkin)
                    {
                        CHeroSkin skin = useable as CHeroSkin;
                        CUICommonSystem.ShowNewHeroOrSkin(skin.m_heroId, skin.m_skinId, enUIEventID.None, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, true, null, enFormPriority.Priority1, 0, 0);
                    }
                    else
                    {
                        CUICommonSystem.ShowNewHeroOrSkin(useable.m_baseID, 0, enUIEventID.None, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, 0, 0);
                    }
                    this._rewardHasSpecial = true;
                }
                else if ((this._rewardShowList.usabList.Count > 1) || !this._rewardHasSpecial)
                {
                    bool flag = (this._rewardShowList.flags & 2) > 0;
                    Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(this._rewardShowList.usabList), Singleton <CTextManager> .GetInstance().GetText(!flag ? "gotAward" : "gotExtraAward"), true, enUIEventID.None, false, false, "Form_Award");

                    this._rewardShowList = null;
                }
                else
                {
                    this._rewardShowList = null;
                    this.ShowNextReward(new CUIEvent());
                }
            }
        }
Beispiel #30
0
        public void CalculateKDA(COMDT_GAME_INFO gameInfo)
        {
            CRoleInfo masterRoleInfo = this.GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "masterRoleInfo is null");
            if (masterRoleInfo != null)
            {
                PlayerKDA hostKDA = Singleton <BattleStatistic> .GetInstance().m_playerKDAStat.GetHostKDA();

                if (hostKDA != null)
                {
                    int num  = 0;
                    int num2 = 0;
                    int num3 = 0;
                    int num4 = 0;
                    int num5 = 0;
                    int num6 = 0;
                    int num7 = 0;
                    IEnumerator <HeroKDA> enumerator = hostKDA.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        if (enumerator.Current != null)
                        {
                            num  += enumerator.Current.LegendaryNum;
                            num2 += enumerator.Current.PentaKillNum;
                            num3 += enumerator.Current.QuataryKillNum;
                            num4 += enumerator.Current.TripleKillNum;
                            num5 += enumerator.Current.DoubleKillNum;
                        }
                    }
                    if (gameInfo.bGameResult == 1)
                    {
                        uint mvpPlayer = Singleton <BattleStatistic> .instance.GetMvpPlayer(hostKDA.PlayerCamp, true);

                        if (mvpPlayer != 0)
                        {
                            num6 = (mvpPlayer != hostKDA.PlayerId) ? 0 : 1;
                        }
                    }
                    else if (gameInfo.bGameResult == 2)
                    {
                        uint num9 = Singleton <BattleStatistic> .instance.GetMvpPlayer(hostKDA.PlayerCamp, false);

                        if (num9 != 0)
                        {
                            num7 = (num9 != hostKDA.PlayerId) ? 0 : 1;
                        }
                    }
                    bool flag  = false;
                    bool flag2 = false;
                    bool flag3 = false;
                    bool flag4 = false;
                    bool flag5 = false;
                    bool flag6 = false;
                    bool flag7 = false;
                    int  index = 0;
                    ListView <COMDT_STATISTIC_KEY_VALUE_INFO> inList = new ListView <COMDT_STATISTIC_KEY_VALUE_INFO>();
                    while (index < masterRoleInfo.pvpDetail.stKVDetail.dwNum)
                    {
                        COMDT_STATISTIC_KEY_VALUE_INFO comdt_statistic_key_value_info = masterRoleInfo.pvpDetail.stKVDetail.astKVDetail[index];
                        switch (((RES_STATISTIC_SETTLE_DATA_TYPE)comdt_statistic_key_value_info.dwKey))
                        {
                        case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_MVP_CNT:
                            comdt_statistic_key_value_info.dwValue += (uint)num6;
                            flag6 = true;
                            break;

                        case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_LOSE_SOUL:
                            comdt_statistic_key_value_info.dwValue += (uint)num7;
                            flag7 = true;
                            break;

                        case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_GODLIKE_CNT:
                            comdt_statistic_key_value_info.dwValue += (uint)num;
                            flag5 = true;
                            break;

                        case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_DOUBLE_KILL_CNT:
                            comdt_statistic_key_value_info.dwValue += (uint)num5;
                            flag = true;
                            break;

                        case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_TRIPLE_KILL_CNT:
                            comdt_statistic_key_value_info.dwValue += (uint)num4;
                            flag2 = true;
                            break;

                        case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_QUATARY_KILL_CNT:
                            comdt_statistic_key_value_info.dwValue += (uint)num3;
                            flag3 = true;
                            break;

                        case RES_STATISTIC_SETTLE_DATA_TYPE.RES_STATISTIC_SETTLE_DATA_TYPE_PENTA_KILL_CNT:
                            comdt_statistic_key_value_info.dwValue += (uint)num2;
                            flag4 = true;
                            break;
                        }
                        index++;
                    }
                    COMDT_STATISTIC_KEY_VALUE_INFO item = null;
                    if (!flag)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x10,
                            dwValue = (uint)num5
                        };
                        inList.Add(item);
                    }
                    if (!flag2)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x11,
                            dwValue = (uint)num4
                        };
                        inList.Add(item);
                    }
                    if (!flag3)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x1b,
                            dwValue = (uint)num3
                        };
                        inList.Add(item);
                    }
                    if (!flag4)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 0x1c,
                            dwValue = (uint)num2
                        };
                        inList.Add(item);
                    }
                    if (!flag5)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 15,
                            dwValue = (uint)num
                        };
                        inList.Add(item);
                    }
                    if (!flag6)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 13,
                            dwValue = (uint)num6
                        };
                        inList.Add(item);
                    }
                    if (!flag7)
                    {
                        item = new COMDT_STATISTIC_KEY_VALUE_INFO {
                            dwKey   = 14,
                            dwValue = (uint)num7
                        };
                        inList.Add(item);
                    }
                    if (inList.Count > 0)
                    {
                        masterRoleInfo.pvpDetail.stKVDetail.dwNum += (uint)inList.Count;
                        inList.AddRange(masterRoleInfo.pvpDetail.stKVDetail.astKVDetail);
                        masterRoleInfo.pvpDetail.stKVDetail.astKVDetail = LinqS.ToArray <COMDT_STATISTIC_KEY_VALUE_INFO>(inList);
                    }
                }
            }
        }