コード例 #1
0
ファイル: DbInfoHelper.cs プロジェクト: ashllay/LQGMTool
        public bool Read()
        {
            if (mInit)
            {
                return(true);
            }
            mInit = true;
            if (!File.Exists(this.dbFile))
            {
                return(false);
            }
            HeroesTextHelper HeroesText = new HeroesTextHelper();

            HeroesText.Read(textFile, patchTextFile);
            MailTitles    = HeroesText.MailTitles;
            ItemStatNames = HeroesText.ItemStatNames;
            SQLiteHelper db = new SQLiteHelper(dbFile);

            db.Open();
            ReadItems(db, HeroesText);
            ReadEnchants(db, HeroesText);
            ReadTitles(db, HeroesText);
            ReadSkillBonuds(db, HeroesText);
            db.Close();
            return(true);
        }
コード例 #2
0
ファイル: DbInfoHelper.cs プロジェクト: ashllay/LQGMTool
 private void ReadItems(SQLiteHelper db, HeroesTextHelper HeroesText)
 {
     using (DbDataReader reader = db.GetReader("SELECT * FROM ItemClassInfo left join equipiteminfo on ItemClassInfo.itemclass = equipiteminfo.itemclass order by RequiredLevel;"))
     {
         while (reader != null && reader.Read())
         {
             Searcher.Add(new ItemClassInfo(reader, HeroesText));
         }
     }
 }
コード例 #3
0
ファイル: DbInfoHelper.cs プロジェクト: ashllay/LQGMTool
 private void ReadSkillBonuds(SQLiteHelper db, HeroesTextHelper HeroesText)
 {
     using (DbDataReader reader = db.GetReader("select * from synthesisskillbonus order by classRestriction;"))
     {
         // MessageBox.Show("count=" + HeroesText.SynSkillBonuds.Count);
         while (reader != null && reader.Read())
         {
             SkillBonusInfo info = new SkillBonusInfo(reader, HeroesText);
             if (!SynthesisSkillBonues.ContainsKey(info.ID))
             {
                 SynthesisSkillBonues.Add(info.ID, info);
             }
         }
     }
 }
コード例 #4
0
ファイル: DbInfoHelper.cs プロジェクト: ashllay/LQGMTool
 private void ReadEnchants(SQLiteHelper db, HeroesTextHelper HeroesText)
 {
     using (DbDataReader reader2 = db.GetReader("SELECT * FROM EnchantInfo ORDER BY EnchantLevel;"))
     {
         while (reader2 != null && reader2.Read())
         {
             EnchantInfo info = new EnchantInfo(reader2, HeroesText);
             if (info.Class.EndsWith("_100"))
             {
                 continue;
             }
             if (!Enchants.ContainsKey(info.Class))
             {
                 Enchants.Add(info.Class, info);
             }
         }
     }
 }
コード例 #5
0
ファイル: DbInfoHelper.cs プロジェクト: ashllay/LQGMTool
        //select titleid,ts.description,targetcount,ispositive,isparty,category,autogivelevel,requiredlevel,classrestriction from ( titlegoalinfo as ts left join  titleinfo as ti on  ti.id=ts.titleid) order by requiredlevel;

        private void ReadTitles(SQLiteHelper db, HeroesTextHelper HeroesText)
        {
            List <TitleInfo> titles = new List <TitleInfo>();

            using (DbDataReader reader = db.GetReader(
                       "select ts.titleid,ti.description as name,feature,tg.description,category,autogivelevel,requiredlevel,classrestriction,tg.targetcount as tcount" +
                       " from (titlestatinfo as ts left join titleinfo as ti on  ts.titleid = ti.id )" +
                       " left join titlegoalinfo as tg on tg.titleid=ts.titleid" +
                       " group by ts.titleid order by requiredlevel"))
            {
                while (reader != null && reader.Read())
                {
                    TitleInfo info = new TitleInfo(reader, HeroesText);
                    if (info.ClassRestriction > 0)
                    {
                        titles.Add(info);
                    }
                }
            }
            foreach (TitleInfo info in titles)
            {
                if (!Titles.ContainsKey(info.TitleID))
                {
                    using (DbDataReader reader = db.GetReader("select * from titlestatinfo where titleID = " + info.TitleID)){
                        while (reader != null && reader.Read())
                        {
                            info.UpdateEffect(reader);
                        }
                        //if(string.IsNullOrEmpty(info.Effect))
                        //	continue;
                    }
                    info.Trim();
                    Titles.Add(info.TitleID, info);
                }
            }
        }