コード例 #1
0
        public bool TryGetListString(string id, out List <string> res)
        {
            res = null;
            Element e;

            if (!AccessElement(id, enumVariousElement.Table, out e))
            {
                return(false);
            }

            VariousTable t = (VariousTable)e.Value;
            int          count;

            if (!t.TryGetInt("Count", out count))
            {
                return(false);
            }
            res = new List <string>();
            for (int i = 0; i < count; i++)
            {
                string v;
                if (!t.TryGetString(i.ToString(), out v))
                {
                    return(false);
                }
                res.Add(v);
            }
            return(true);
        }
コード例 #2
0
        public bool TryGetClassList <T>(string id, out List <T> res) where T : class, IVariousTableElement, new()
        {
            res = null;
            Element e;

            if (!AccessElement(id, enumVariousElement.Table, out e))
            {
                return(false);
            }

            VariousTable t = (VariousTable)e.Value;
            int          count;

            if (!t.TryGetInt("Count", out count))
            {
                return(false);
            }
            res = new List <T>();
            for (int i = 0; i < count; i++)
            {
                T v;
                if (!t.TryGetClass(i.ToString(), out v))
                {
                    return(false);
                }
                res.Add(v);
            }
            return(true);
        }