예제 #1
0
        private static Dictionary <int, DropInfo> LoadDropInfo()
        {
            Dictionary <int, DropInfo> dictionary = new Dictionary <int, DropInfo>();

            if (File.Exists(MacroDropMgr.FilePath))
            {
                IniReader iniReader = new IniReader(MacroDropMgr.FilePath);
                int       num       = 1;
                while (iniReader.GetIniString(num.ToString(), "TemplateId") != "")
                {
                    string   section  = num.ToString();
                    int      id       = Convert.ToInt32(iniReader.GetIniString(section, "TemplateId"));
                    int      time     = Convert.ToInt32(iniReader.GetIniString(section, "Time"));
                    int      num2     = Convert.ToInt32(iniReader.GetIniString(section, "Count"));
                    DropInfo dropInfo = new DropInfo(id, time, num2, num2);
                    dictionary.Add(dropInfo.ID, dropInfo);
                    num++;
                }
                return(dictionary);
            }
            return(null);
        }
예제 #2
0
        private static Dictionary <int, DropInfo> LoadDropInfo()
        {
            Dictionary <int, DropInfo> items = new Dictionary <int, DropInfo>();

            if (File.Exists(FilePath))
            {
                IniReader reader = new IniReader(FilePath);
                int       i      = 1;
                while (reader.GetIniString(i.ToString(), "TemplateId") != "")
                {
                    string   section = i.ToString();
                    int      id      = Convert.ToInt32(reader.GetIniString(section, "TemplateId"));
                    int      time    = Convert.ToInt32(reader.GetIniString(section, "Time"));
                    int      count   = Convert.ToInt32(reader.GetIniString(section, "Count"));
                    DropInfo info    = new DropInfo(id, time, count, count);
                    items.Add(info.ID, info);
                    i++;
                }
                return(items);
            }

            return(null);
        }