namespace Zinnia.Rule
{
using UnityEngine;
using Zinnia.Extension;
///
/// Negates the acceptance of an object based on the acceptance of another .
///
public class NegationRule : Rule
{
[Tooltip("The IRule to negate.")]
[SerializeField]
private RuleContainer rule;
///
/// The to negate.
///
public RuleContainer Rule
{
get
{
return rule;
}
set
{
rule = value;
}
}
///
public override bool Accepts(object target)
{
if (ShouldAutoRejectDueToState())
{
return false;
}
return !Rule.Accepts(target);
}
}
}