예제 #1
0
        //---------------------------------------------------------------------
        public Prop <T> defProp <T>(Dictionary <string, string> map_param, string key, T default_value, bool collect_dirty = true)
        {
            PropDef prop_def = new PropDef(key, typeof(T), collect_dirty);

            mMapPropDef[prop_def.getKey()] = prop_def;
            Prop <T> prop = new Prop <T>(this, prop_def, default_value);

            mMapProp[prop_def.getKey()] = prop;

            if (map_param == null)
            {
                return(prop);
            }

            string json = null;

            if (map_param.TryGetValue(prop_def.getKey(), out json))
            {
                if (!string.IsNullOrEmpty(json))
                {
                    prop.set(EbTool.jsonDeserialize <T>(json));
                }
            }

            return(prop);
        }
예제 #2
0
 //-----------------------------------------------------------------------------
 public string getKey()
 {
     return(mPropDef.getKey());
 }
예제 #3
0
파일: EbData.cs 프로젝트: yinlei/Fishing
 //---------------------------------------------------------------------
 internal void _addPropDef(PropDef prop_def)
 {
     mMapPropDef[prop_def.getKey()] = prop_def;
 }
예제 #4
0
 //---------------------------------------------------------------------
 internal void _addPropDef(PropDef prop_def)
 {
     mMapPropDef[prop_def.getKey()] = prop_def;
 }