public virtual Boolean Evaluate(KeyStore keys) { if ((keys.Contains(key) && !negative) || (!keys.Contains(key) && negative)) return true; else return false; }
public void Validate(KeyStore keys) { foreach (Dialog dialog in dialogs) { if (dialog.condition == null || dialog.condition.Evaluate(keys)) validDialogs.Add(dialog); } foreach (Choice choice in choices) { if (choice.condition == null || choice.condition.Evaluate(keys)) validChoices.Add(choice); } foreach (ScriptElement element in orderedElements) { if (element.condition == null || element.condition.Evaluate(keys)) validElements.Add(element); } }
public override Boolean Evaluate(KeyStore keys) { switch (op) { case BooleanOperator.AND: return operand1.Evaluate(keys) && operand2.Evaluate(keys); case BooleanOperator.OR: return operand1.Evaluate(keys) || operand2.Evaluate(keys); } return false; }