protected Rule ruleMatch(ObjectWithDynamicAttributes state,
     HashSet<Rule> rulesSet)
 {
     foreach (Rule r in rulesSet)
     {
         if (r.evaluate(state))
         {
             return r;
         }
     }
     return null;
 }
Пример #2
0
        /**
         * Creates and returns a copy of this ObjectWithDynamicAttributes
         */
        public ObjectWithDynamicAttributes copy()
        {
            ObjectWithDynamicAttributes copy = null;

            try
            {
                copy = (ObjectWithDynamicAttributes)this.GetType().GetConstructor(System.Type.EmptyTypes).Invoke(null);
                foreach (object val in attributes)
                {
                    copy.attributes.Add(val, attributes[val]);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
            }

            return(copy);
        }
Пример #3
0
 public override bool evaluate(ObjectWithDynamicAttributes p)
 {
     return (left.evaluate(p) || right.evaluate(p));
 }
Пример #4
0
 public override bool evaluate(ObjectWithDynamicAttributes p)
 {
     return value.Equals(p.getAttribute(key));
 }
Пример #5
0
 public bool evaluate(ObjectWithDynamicAttributes p)
 {
     return (con.evaluate(p));
 }
Пример #6
0
 public abstract bool evaluate(ObjectWithDynamicAttributes p);
Пример #7
0
 public override bool evaluate(ObjectWithDynamicAttributes p)
 {
     return (!con.evaluate(p));
 }