Example #1
0
        internal void RegisterNewProperty(TreeNode treeNode)
        {
            //validate the node (some nodes will need a second dialog opened,
            //some may not actually lead to the registration of a new property
            //(i.e. if it would require more slots than are currently available))

            Type            propertyType = asm.GetType("Elena." + treeNode.Name);
            bool            propertyGenerated;
            MonsterProperty property;

            try
            {
                property          = (MonsterProperty)Activator.CreateInstance(propertyType);
                propertyGenerated = true;
            }
            catch
            {
                propertyGenerated = false;
                property          = new NullProperty();
            }
            if (propertyGenerated)
            {
                monster.AddProperty(property);
            }
            this.UpdateData();
        }
        /**
         * Get the named property. If it doesn't exist, a new NullProperty object is
         * created with the same name and returned.
         */
        public NetMeterProperty getProperty(String key)
        {
            NetMeterProperty prop;

            if (!propDic.TryGetValue(key, out prop))
            {
                prop = new NullProperty(key);
            }
            return(prop);
        }
Example #3
0
 /**
  * Get the named property. If it doesn't exist, a new NullProperty object is
  * created with the same name and returned.
  */
 public NetMeterProperty getProperty(String key)
 {
     NetMeterProperty prop;
     if(!propDic.TryGetValue(key, out prop))
     {
         prop = new NullProperty(key);
     }
     return prop;
 }
Example #4
0
        internal void RegisterNewProperty(TreeNode treeNode)
        {
            //validate the node (some nodes will need a second dialog opened,
            //some may not actually lead to the registration of a new property
            //(i.e. if it would require more slots than are currently available))

            Type propertyType = asm.GetType("Elena." + treeNode.Name);
            bool propertyGenerated;
            MonsterProperty property;
            try
            {
                property = (MonsterProperty)Activator.CreateInstance(propertyType);
                propertyGenerated = true;
            }
            catch
            {
                propertyGenerated = false;
                property = new NullProperty();
            }
            if (propertyGenerated)
            {
                monster.AddProperty(property);
            }
            this.UpdateData();
        }