Beispiel #1
0
    protected override bool SpecificEvaluate(ContextRuleUpdater ruleUpdater)
    {
        foreach (ContextRule rule in childrenRules)
        {
            if (rule.Evaluate(ruleUpdater))
            {
                return(true);
            }
        }

        return(false);
    }
    public bool Evaluate(ContextRuleUpdater ruleUpdater)
    {
        if (Dirty)
        {
            bool previousResult = lastEvaluationResult;
            lastEvaluationResult = SpecificEvaluate(ruleUpdater);

            if (ruleUpdater != null && previousResult != lastEvaluationResult)
            {
                ruleUpdater.DirtyRules(parentRules);
            }

            Dirty = false;
        }

        return(lastEvaluationResult);
    }
 protected abstract bool SpecificEvaluate(ContextRuleUpdater ruleUpdater);
 protected override bool SpecificEvaluate(ContextRuleUpdater ruleUpdater)
 {
     return(playerClass == CurrentPlayerClass);
 }
Beispiel #5
0
 protected override bool SpecificEvaluate(ContextRuleUpdater ruleUpdater)
 {
     return(!ruleToInvert.Evaluate(ruleUpdater));
 }