java.lang.Object
cn.wjybxx.btree.Task<T>
cn.wjybxx.btree.Decorator<T>
cn.wjybxx.btree.decorator.LoopDecorator<T>
- 所有已实现的接口:
ICancelTokenListener
- 直接已知子类:
Repeat,UntilCond,UntilFail,UntilSuccess
循环节点抽象
- 作者:
- wjybxx date - 2023/11/26
-
字段概要
字段从类继承的字段 cn.wjybxx.btree.Decorator
child, inlineHelper -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected void模板类不重写enter方法,只有数据初始化逻辑protected voidexecute()Task的心跳方法,在Task进入完成状态之前会反复执行。intprotected boolean是否还有下一次循环voidsetMaxLoop(int maxLoop) 从类继承的方法 cn.wjybxx.btree.Decorator
addChildImpl, exit, getChild, getChild, getChildCount, getInlineHelper, indexChild, onChildRunning, 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, onChildCompleted, 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
-
字段详细资料
-
maxLoop
protected int maxLoop最大循环次数,超过次数直接失败;大于0有效 -
curLoop
protected transient int curLoop执行前+1,因此从1开始
-
-
构造器详细资料
-
LoopDecorator
public LoopDecorator() -
LoopDecorator
-
-
方法详细资料
-
beforeEnter
protected void beforeEnter()从类复制的说明:Decorator模板类不重写enter方法,只有数据初始化逻辑- 覆盖:
beforeEnter在类中Decorator<T>
-
execute
protected void execute()从类复制的说明:TaskTask的心跳方法,在Task进入完成状态之前会反复执行。 1.可以根据Task.isExecuteTriggeredByEnter()判断是否是与Task.enter(int)连续执行的。 2.运行中可通过Task.setSuccess()、Task.setFailed(int)、Task.setCancelled()将自己更新为完成状态。 3.不建议直接调用该方法,而是通过模板方法Task.template_execute(boolean)运行。 -
hasNextLoop
protected boolean hasNextLoop()是否还有下一次循环 -
getMaxLoop
public int getMaxLoop() -
setMaxLoop
public void setMaxLoop(int maxLoop)
-