/// <summary> /// Will be executed frequently to check whether this task/subtree is ready to run. /// </summary> /// <returns>Returns true if the task/subtree is ready and can be started; otherwise, false.</returns> public override bool CheckConditions() { if (active != null) { return(true); } do { if (impulses.Count == 0) { active = null; return(false); } active = impulses[0]; impulses.Remove(active); string sourceName = sourceVariable; if (sourceName.Length > 0) { Context.Variables[sourceName] = active.Source; } string dataName = dataVariable; if (dataName.Length > 0) { Context.Variables[dataName] = active.Data; } } while (!Subtask.CheckConditions()); return(true); }
/// <summary> /// Will be executed each frame while the task is running. /// </summary> public override void DoAction() { if (!Subtask.Started) { if (Subtask.CheckConditions()) { Subtask.SafeStart(); } } else if (Subtask.Finished) { Subtask.Reset(); } else { Subtask.DoAction(); } }
/// <summary> /// Will be executed each frame while the task is running. /// </summary> public override void DoAction() { if (!Subtask.Finished) { Subtask.DoAction(); } else { Subtask.SafeEnd(); if (Subtask.CheckConditions()) { Subtask.SafeStart(); } else { Finish(); } } }
/// <summary> /// Will be executed each frame while the task is running. /// </summary> public override void DoAction() { Subtask.DoAction(); if (Subtask.Finished) { if (++iteration < iterations) { Subtask.Reset(); if (Subtask.CheckConditions()) { Subtask.SafeStart(); } else { Finish(); } } else { Finish(); } } }
/// <summary> /// Will be executed frequently to check whether this task/subtree is ready to run. /// </summary> /// <returns>Returns true if the task/subtree is ready and can be started; otherwise, false.</returns> public override bool CheckConditions() { return(TaskContext <DataType> .GlobalSemaphores[identifier] < concurrentExecutions && Subtask.CheckConditions()); }
/// <summary> /// Will be executed frequently to check whether this task/subtree is ready to run. /// </summary> /// <returns>Returns true if the task/subtree is ready and can be started; otherwise, false.</returns> public override bool CheckConditions() { conditions = Subtask.CheckConditions(); return(true); }
/// <summary> /// Will be executed frequently to check whether this task/subtree is ready to run. /// </summary> /// <returns>Returns true if the task/subtree is ready and can be started; otherwise, false.</returns> public override bool CheckConditions() { return(Subtask.CheckConditions()); }
/// <summary> /// Will be executed frequently to check whether this task/subtree is ready to run. /// </summary> /// <returns>Returns true if the task/subtree is ready and can be started; otherwise, false.</returns> public override bool CheckConditions() { return(Context.LocalSemaphores[identifier] < concurrentExecutions && Subtask.CheckConditions()); }
/// <summary> /// Will be executed frequently to check whether this task/subtree is ready to run. /// </summary> /// <returns>Returns true if the task/subtree is ready and can be started; otherwise, false.</returns> public override bool CheckConditions() { return(iterations > 0 && Subtask.CheckConditions()); }
/// <summary> /// Will be executed frequently to check whether this task/subtree is ready to run. /// </summary> /// <returns>Returns true if the task/subtree is ready and can be started; otherwise, false.</returns> public override bool CheckConditions() { return(nextAction <= Context.Time && Subtask.CheckConditions()); }