Example #1
0
        public static void Decode_Dictionary(this string data, out Dictionary <string, string> dic)
        {
            var cody = new CfgDecoder(data);

            dic = new Dictionary <string, string>();

            while (cody.GotData)
            {
                dic.Add(cody.GetTag(), cody.GetData());
            }
        }
Example #2
0
        public static void Decode <T>(this string data, out T val, TaggedTypesCfg typeList) where T : IGotClassTag
        {
            val = default(T);

            var cody = new CfgDecoder(data);

            var type = typeList.TaggedTypes.TryGet(cody.GetTag());

            if (type != null)
            {
                val = cody.GetData().DecodeInto_Type <T>(type);
            }
        }
Example #3
0
        public static List <List <T> > Decode_ListOfList <T>(this string data, out List <List <T> > l) where T : ICfg, new()
        {
            l = new List <List <T> >();

            var cody = new CfgDecoder(data);

            while (cody.GotData)
            {
                cody.GetTag();
                List <T> el;
                cody.GetData().Decode_List(out el);
                l.Add(el);
            }

            return(l);
        }