public override void ChildFail(TaskId task) { this.Fail(); }
public override void ChildRunning(TaskId task, TaskId reporter) { this.Running(); }
public override void ChildSuccess(TaskId task) { this.Success(); }
public override void ChildRunning(TaskId task, TaskId reporter) { base.ChildRunning(task, reporter); this.Condition = false; }
/// <summary> /// Creates a decorator that wraps the given task /// </summary> /// <param name="child">the task that will be wrapped</param> public Decorator(TaskId child) { this.Child = child; }
public override void ChildFail(TaskId task) { this.RunningChild = TaskId.Invalid; }
protected LoopDecorator(TaskId child) : base(child) { }
// ------------------------------------------------------------------- // Protected // ------------------------------------------------------------------- /// <summary> /// This method will add a child to the list of this task's children /// </summary> /// <param name="child">the child task which will be added</param> /// <returns>the index where the child has been added</returns> /// <exception cref="IllegalStateException">if the child cannot be added for whatever reason</exception> protected abstract int AddChildToTask(TaskId child);
public override void ChildSuccess(TaskId task) { this.RunningChild = TaskId.Invalid; }
/// <summary> /// This method will be called when one of the children of this task fails /// </summary> /// <param name="task">the task that failed</param> public abstract void ChildFail(TaskId task);
/// <summary> /// This method will be called when one of the children of this task succeeds /// </summary> /// <param name="task">the task that succeeded</param> public abstract void ChildSuccess(TaskId task);
/// <summary> /// This method will be called when one of the ancestors of this task needs to run again /// </summary> /// <param name="task">the task that needs to run again</param> /// <param name="reporter">the task that reports, usually one of this task's children</param> public abstract void ChildRunning(TaskId task, TaskId reporter);
/// <summary> /// This method will set a task as this task's control (parent) /// </summary> /// <param name="parent">the parent task</param> /// <param name="parentStream">the stream of the parent task</param> public void SetControl(TaskId parent, BehaviorStream <T> parentStream) { this.Control = parent; this.Stream = parentStream; }
// ------------------------------------------------------------------- // Protected // ------------------------------------------------------------------- protected override int AddChildToTask(TaskId child) { this.Children.Add(child); return(this.Children.Count - 1); }