using System;
namespace SK.Framework
{
///
/// 条件事件(当...)
///
public class WhileAction : AbstractAction
{
private readonly Action action;
private readonly Func predicate;
public WhileAction(Func predicate, Action action)
{
this.predicate = predicate;
this.action = action;
}
protected override void OnInvoke()
{
action?.Invoke();
isCompleted = !predicate.Invoke();
}
}
}