public void RegisterRunning(TreeTask <TBb> task) { CurrentlyRunning.Add(task); // We remove it here to spare some cycles later on. if (task.PreviousTickState == TaskState.Running) { PreviouslyRunning.Remove(task); } // The first one to report running is the deepest running one if (RunningTask == null) { RunningTask = task; } }
private bool TryToRerunPreviouslyRunningTask() { if (CurrentState == TaskState.Running && RunningTaskHysterisis < _taskHysterisisRuns && Context.RunningTask != null) { TreeTask <TBb> task = Context.RunningTask; _taskHysterisisRuns++; task.Tick(); if (task.State == TaskState.Running) { return(true); } } return(false); }
LispParser.ICanCreateFromLispParseTree <TBb> LispParser.ICanCreateFromLispParseTree <TBb> .CreateFromParseTree(TBb blackboard, LispParser.Node node, LispParser.ICompiler <TBb> compiler) { LispParser.MethodNode method = node as LispParser.MethodNode; if (method == null) { return(null); } if (method.MethodName == GetClassName()) { TreeTask <TBb> treeTask = CreateTreeTaskFromParseTree(blackboard, method, compiler); foreach (LispParser.Node child in method.Children) { child.NamedParamX <LispParser.StringNode>("Name", v => treeTask.Name = v.Value); } return(treeTask); } else { return(null); } }
public void RegisterNoLongerRunning(TreeTask <TBb> task) { PreviouslyRunning.Remove(task); }
public Counter(TreeTask <TBb> decoratedTask) : base(decoratedTask) { }
public AlwaysFail(TreeTask <TBb> decoratedTask) : base(decoratedTask) { }
protected Decorator(TreeTask <TBb> decoratedTask) : this(null, decoratedTask) { }
public AlwaysSucceed(TreeTask <TBb> decoratedTask) : base(decoratedTask) { }
protected Decorator(string name, TreeTask <TBb> decoratedTask) : base(name) { DecoratedTask = decoratedTask; }
public RunNTimes(TreeTask <TBb> decoratedTask) : base(decoratedTask) { }
public RunOnce(TreeTask <TBb> decoratedTask) : base(decoratedTask) { }
public UntilSuccess(TreeTask <TBb> decoratedTask) : base(decoratedTask) { }
public UntilFail(TreeTask <TBb> decoratedTask) : base(decoratedTask) { }
public Invert(TreeTask <TBb> decoratedTask) : base(decoratedTask) { }
public BehaviourTree(string name, TreeTask <TBb> rootTask) { Name = name; RootTask = rootTask; RunningTaskHysterisis = 10; }
public SemaphoreGuard(TreeTask <TBb> decoratedTask) : base(decoratedTask) { }
public TaskUtility(LispOperator <TBb> utilityComputer, TreeTask <TBb> task) { UtilityComputer = utilityComputer; Task = task; }