コード例 #1
0
ファイル: SelectArrayTip.cs プロジェクト: zwong91/Titan
        // 初始化csv表
        protected void InitSelectArrayTipPageCsv(string stPath)
        {
            // string stSchemeAllText = File.ReadAllText(stPath);
            ScpReader reader = new ScpReader(stPath, true, 2);

            allSelectArrayTipPageTable = new Hashtable();
            int nIndex = (int)SELECTARRAYTIP.EMT_ID;

            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeSelectArrayTipConfig sConfig = new SSchemeSelectArrayTipConfig();
                sConfig.nId                = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.sName              = reader.GetString(i, (int)nIndex++, "");
                sConfig.nTiplimit          = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nAssassinDown      = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nAssassinUp        = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nSoldier_limitDown = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nSoldier_limitUp   = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nMagicDown         = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nMagicUp           = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nAdcDown           = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nAdcUp             = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nSupportDown       = reader.GetInt(i, (int)nIndex++, 0);
                sConfig.nSupportUp         = reader.GetInt(i, (int)nIndex++, 0);
                allSelectArrayTipPageTable[sConfig.nId] = sConfig;
            }

            InitSelectArrayTypeWord((int)MatchType.MatchType_One);
        }
コード例 #2
0
ファイル: SelectArrayTip.cs プロジェクト: zwong91/Titan
        public int GetHeroCampTipLimit(int nMatchId)
        {
            if (allSelectArrayTipPageTable == null || !allSelectArrayTipPageTable.ContainsKey(nMatchId))
            {
                return(-1);
            }

            SSchemeSelectArrayTipConfig sConfig = allSelectArrayTipPageTable[nMatchId] as SSchemeSelectArrayTipConfig;

            if (sConfig == null)
            {
                return(-1);
            }

            return(sConfig.nTiplimit);
        }
コード例 #3
0
ファイル: SelectArrayTip.cs プロジェクト: zwong91/Titan
        private void InitSelectArrayTypeWord(int nMatchId)
        {
            if (allSelectArrayTipPageTable == null || !allSelectArrayTipPageTable.ContainsKey(nMatchId))
            {
                return;
            }

            SSchemeSelectArrayTipConfig sConfig = allSelectArrayTipPageTable[nMatchId] as SSchemeSelectArrayTipConfig;

            dicTypeInitInfo.Clear();
            string UpWord     = "";
            string DownWord   = "";
            int    nUpCount   = 0;
            int    nDownCount = 0;

            for (int nTipTypeIndex = (int)HeroType.HEROTYPE_ASSASSIN; nTipTypeIndex < (int)HeroType.HEROTYPE_ALL; nTipTypeIndex++)
            {
                SelectTeamLimitInfo LimitInfo = new SelectTeamLimitInfo();
                HeroType            nHeroType = (HeroType)nTipTypeIndex;
                switch (nHeroType)
                {
                case HeroType.HEROTYPE_ASSASSIN:
                {
                    DownWord   = "坦克英雄不足";
                    UpWord     = "坦克英雄过多";
                    nUpCount   = sConfig.nAssassinUp;
                    nDownCount = sConfig.nAssassinDown;
                }
                break;

                case HeroType.HEROTYPE_SOLDIER:
                {
                    DownWord   = "战士英雄不足";
                    UpWord     = "战士英雄过多";
                    nUpCount   = sConfig.nSoldier_limitUp;
                    nDownCount = sConfig.nSoldier_limitDown;
                }
                break;

                case HeroType.HEROTYPE_MAGIC:
                {
                    DownWord   = "法师英雄不足";
                    UpWord     = "法师英雄过多";
                    nUpCount   = sConfig.nMagicUp;
                    nDownCount = sConfig.nMagicDown;
                }
                break; break;

                case HeroType.HEROTYPE_ADC:
                {
                    DownWord   = "射手英雄不足";
                    UpWord     = "射手英雄过多";
                    nUpCount   = sConfig.nAdcUp;
                    nDownCount = sConfig.nAdcDown;
                }
                break;

                case HeroType.HEROTYPE_SUPPORT:
                {
                    DownWord   = "辅助英雄不足";
                    UpWord     = "辅助英雄过多";
                    nUpCount   = sConfig.nSupportUp;
                    nDownCount = sConfig.nSupportDown;
                }
                break;

                default:
                    break;
                }

                LimitInfo.sTypeLimitWord[(int)LimitType.LIMITTYPE_UP]    = UpWord;
                LimitInfo.sTypeLimitWord[(int)LimitType.LIMITTYPE_DOWN]  = DownWord;
                LimitInfo.nTypeLimitCount[(int)LimitType.LIMITTYPE_UP]   = nUpCount;
                LimitInfo.nTypeLimitCount[(int)LimitType.LIMITTYPE_DOWN] = nDownCount;
                dicTypeInitInfo[nHeroType] = LimitInfo;
            }
        }