protected Rule ruleMatch(ObjectWithDynamicAttributes state,
     HashSet<Rule> rulesSet)
 {
     foreach (Rule r in rulesSet)
     {
         if (r.evaluate(state))
         {
             return r;
         }
     }
     return null;
 }
Exemple #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);
        }
Exemple #3
0
 public override bool evaluate(ObjectWithDynamicAttributes p)
 {
     return (left.evaluate(p) || right.evaluate(p));
 }
 public override bool evaluate(ObjectWithDynamicAttributes p)
 {
     return value.Equals(p.getAttribute(key));
 }
Exemple #5
0
 public bool evaluate(ObjectWithDynamicAttributes p)
 {
     return (con.evaluate(p));
 }
Exemple #6
0
 public abstract bool evaluate(ObjectWithDynamicAttributes p);
 public override bool evaluate(ObjectWithDynamicAttributes p)
 {
     return (!con.evaluate(p));
 }