java.lang.Object
cn.wjybxx.btree.Task<T>
cn.wjybxx.btree.Decorator<T>
cn.wjybxx.btree.decorator.LoopDecorator<T>
cn.wjybxx.btree.decorator.UntilSuccess<T>
- 所有已实现的接口:
ICancelTokenListener
重复运行子节点,直到该任务成功
- 作者:
- wjybxx date - 2023/11/26
-
字段概要
从类继承的字段 cn.wjybxx.btree.decorator.LoopDecorator
curLoop, maxLoop从类继承的字段 cn.wjybxx.btree.Decorator
child, inlineHelper -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected voidonChildCompleted(Task<T> child) 子节点进入完成状态 1.避免方法数太多,实现类测试task的status即可 2.Task.getNormalizedStatus()有助于switch测试 3.task可能是取消状态,甚至可能没运行过直接失败(前置条件失败) 4.钩子任务和guard不会调用该方法 5.Task.isExecuting()有助于检测冲突,减少调用栈深度 6.同一子节点连续通知的情况下,completed的逻辑应当覆盖Task.onChildRunning(Task)的影响。protected voidonChildRunning(Task<T> child) 子类如果支持内联,则重写该方法(超类不能安全内联)从类继承的方法 cn.wjybxx.btree.decorator.LoopDecorator
beforeEnter, execute, getMaxLoop, hasNextLoop, setMaxLoop从类继承的方法 cn.wjybxx.btree.Decorator
addChildImpl, exit, getChild, getChild, getChildCount, getInlineHelper, indexChild, onEventImpl, removeChildImpl, resetForRestart, setChild, setChildImpl, stopRunningChildren, visitChildren从类继承的方法 cn.wjybxx.btree.Task
addChild, canHandleEvent, checkCancel, enter, exportControlFlowOptions, getBlackboard, getCancelToken, getControl, getControlData, getControlFlowOptions, getEnterFrame, getEntity, getExitFrame, getFlags, getGuard, getNormalizedStatus, getPrevStatus, getReentryId, getRunFrames, getSharedProps, getStatus, getTaskEntry, isActiveInHierarchy, isActiveSelf, isAutoListenCancel, isAutoResetChildren, isBlackboardPerChild, isCancelled, isCancelTokenPerChild, isCheckingGuard, isCompleted, isExecuteTriggeredByEnter, isExecuting, isExited, isExitTriggeredByStop, isFailed, isFailedOrCancelled, isInlinable, isInvertedGuard, isManualCheckCancel, isRunning, isSlowStart, isStillborn, isSucceeded, onActiveInHierarchyChanged, onCancelRequested, onEvent, registerCancelListener, removeAllChild, removeChild, removeChild, resetChildrenForRestart, resetForRestart, setActive, setAutoListenCancel, setAutoResetChildren, setBlackboard, setBlackboardPerChild, setCancelled, setCancelToken, setCancelTokenPerChild, setChild, setChildCancelToken, setCompleted, setControl, setControlData, setEnterFrame, setExitFrame, setFailed, setFlags, setGuard, setGuardFailed, setInvertedGuard, setManualCheckCancel, setPrevStatus, setSharedProps, setSlowStart, setSuccess, stop, stop, template_checkGuard, template_execute, template_runInlinedChild, template_startChild, template_startHook, unsetChildCancelToken, unsetControl
-
构造器详细资料
-
UntilSuccess
public UntilSuccess() -
UntilSuccess
-
-
方法详细资料
-
onChildRunning
从类复制的说明:Decorator子类如果支持内联,则重写该方法(超类不能安全内联)- 覆盖:
onChildRunning在类中Decorator<T>
-
onChildCompleted
从类复制的说明:Task子节点进入完成状态 1.避免方法数太多,实现类测试task的status即可 2.Task.getNormalizedStatus()有助于switch测试 3.task可能是取消状态,甚至可能没运行过直接失败(前置条件失败) 4.钩子任务和guard不会调用该方法 5.Task.isExecuting()有助于检测冲突,减少调用栈深度 6.同一子节点连续通知的情况下,completed的逻辑应当覆盖Task.onChildRunning(Task)的影响。 7.任何的回调和事件方法中都由用户自身检测取消信号- 指定者:
onChildCompleted在类中Task<T>
-