Exemple #1
0
        public bool EvaluateRules(out BaseRule failedRule)
        {
            foreach (var activeRule in ActiveRules)
            {
                var rulePassed = activeRule.Evaluate();
                if (!rulePassed)
                {
                    failedRule = activeRule;
                    return(false);
                }
            }

            failedRule = null;
            return(true);
        }
Exemple #2
0
 public void RemoveRule(BaseRule rule)
 {
     ActiveRules.Remove(rule);
 }
Exemple #3
0
 public void AddRule(BaseRule rule)
 {
     rule.Initialize(room);
     ActiveRules.Add(rule);
 }