예제 #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);
        }
예제 #2
0
 public void RemoveRule(BaseRule rule)
 {
     ActiveRules.Remove(rule);
 }
예제 #3
0
 public void AddRule(BaseRule rule)
 {
     rule.Initialize(room);
     ActiveRules.Add(rule);
 }