bool ActiveRule(IDirectionRule rule, DataSample data) { if (rule.IsActive(data)) { currentRule = rule; rule.Direct(data); return(true); } return(false); }
public void Process(DataSample data) { if (ActiveRule(currentRule, data)) return; foreach (var rule in directionRules) if (ActiveRule(rule, data)) return; currentRule = ruleRandom; currentRule.Direct(data); }
public void Direct(DataSample data) { if (isVetoed) { vetoRule.Direct(data); return; } if (wasVetored) { mainRule.Redirect(data); } wasVetored = false; mainRule.Direct(data); }
public void Process(DataSample data) { if (ActiveRule(currentRule, data)) { return; } foreach (var rule in directionRules) { if (ActiveRule(rule, data)) { return; } } currentRule = ruleRandom; currentRule.Direct(data); }
bool ActiveRule(IDirectionRule rule, DataSample data) { if (rule.IsActive(data)) { currentRule = rule; rule.Direct(data); return true; } return false; }