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