using JD.TeaBoxAddinSystem.Addins.Description.Conditions;
using JD.TeaBoxAddinSystem.Addins.Internal;
namespace JD.TeaBoxAddinSystem.Addins
{
///
/// A condition node is an object that evaluates to true or false.
///
///
/// Implementors must call if the result of the evaluation could have changed.
///
public abstract class ConditionNode : Node
{
#region Properties
///
/// Type of this condition node.
///
public new ConditionType Type
{
get
{
return (ConditionType)base.Type;
}
}
internal virtual bool Polled
{
get
{
return false;
}
}
#endregion
#region Methods
///
/// Returns true if the condition is satisfied.
///
/// True if the condition is satisfied, false otherwise.
public abstract bool Evaluate();
///
/// This method should be called when the result of could have changed.
///
protected void NotifyChanged()
{
AddinManager.SessionService.ConditionManager.OnConditionChanged(this);
}
#endregion
}
}