예제 #1
0
        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();
            }
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
        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();
            }
        }
예제 #4
0
 public override TaskState Execute()
 {
     ExecuteCount++;
     return(DecoratedTask.Tick());
 }
예제 #5
0
 public override TaskState Execute()
 {
     DecoratedTask.Tick();
     return(TaskState.Failure);
 }
예제 #6
0
 public override TaskState Execute()
 {
     DecoratedTask.Tick();
     return(TaskState.Success);
 }