Пример #1
0
        private IEnumerator load1(string url, string key, OnValues1 cb)
        {
            yield return(load(url, (string text) =>
            {
                var dic = new Dictionary <int, CsvValue>();
                string[] keys = null;
                using (StringReader sr = new StringReader(text))
                {
                    string line;
                    bool is_head_line = true;
                    while ((line = sr.ReadLine()) != null)
                    {
                        if (is_head_line)
                        {
                            is_head_line = false;
                            keys = line2items(line);
                        }
                        else
                        {
                            var csv_value = new CsvValue();
                            csv_value.parseLine(
                                Path.GetFileName(url), keys, line2items(line));
                            csv_value.findKey(key);
                            dic[csv_value.key] = csv_value;
                        }
                    }
                }

                cb(dic);
            }));
        }
Пример #2
0
 public V tryParse(CsvValue v)
 {
     try
     {
         return(parse(v));
     }
     catch (Exception ex)
     {
         Log.warning(v.debugInfo);
         Collector.Error.add(this, ex, v.debugInfo);
         return(default(V));
     }
 }
Пример #3
0
        public override MonsterPresetDataValueData parse(CsvValue v)
        {
            ID             = v.getInt("ID");
            NAME           = v.getStr("NAME");
            move           = v.getFloat("move");
            activation     = v.getInt("activation");
            activerange    = v.getInt("activerange");
            losttargettime = v.getInt("losttargettime");
            viewrange      = v.getInt("viewrange");
            viewagent      = v.getInt("viewagent");
            attackrange    = v.getInt("attackrange");
            attacktype     = v.getInt("attacktype");
            dps            = v.getInt("dps");
            attackbuffId   = v.getInt("attackbuffId");
            hp             = v.getInt("hp");

            return(this);
        }
Пример #4
0
 public abstract V parse(CsvValue v);