public override TaskState Execute() { switch (DecoratedTask.Tick()) { case TaskState.Success: return(TaskState.Success); case TaskState.Failure: case TaskState.Running: return(TaskState.Running); default: throw new ArgumentOutOfRangeException(); } }
public override TaskState Execute() { if (HasBeenRun) { return(Result.Value); } Result = DecoratedTask.Tick(); switch (Result.Value) { case TaskState.Success: case TaskState.Failure: HasBeenRun = true; return(Result.Value); case TaskState.Running: return(TaskState.Running); default: throw new ArgumentOutOfRangeException(); } }
public override TaskState Execute() { if (RunTimes >= MaxRunTimes) { RunTimes++; return(TaskState.Failure); } TaskState result = DecoratedTask.Tick(); switch (result) { case TaskState.Success: case TaskState.Failure: RunTimes++; return(result); case TaskState.Running: return(TaskState.Running); default: throw new ArgumentOutOfRangeException(); } }
public override TaskState Execute() { ExecuteCount++; return(DecoratedTask.Tick()); }
public override TaskState Execute() { DecoratedTask.Tick(); return(TaskState.Failure); }
public override TaskState Execute() { DecoratedTask.Tick(); return(TaskState.Success); }