protected override Status Update(Blackboard blackboard) { if (Child.TickUpdate(blackboard) != Status.Running) { return(FixedStatus.GetValue(blackboard)); } return(Status.Running); }
protected override void OnInitialize(Blackboard blackboard) { shouldRun = Predicate.GetValue(blackboard); if (Negate.GetValue(blackboard)) { shouldRun = !shouldRun; } }
protected override void OnInitialize(Blackboard blackboard) { if (Child == null) { resolvedTemplateName = TemplateName.GetValue(blackboard); Child = blackboard.InstanciateTemplate(resolvedTemplateName); } }
protected override Status Update(Blackboard blackboard) { // If we're throttled, fail if (DateTime.Now < throttledUntil) { if (BlockOnStatus != null && Child.Status == BlockOnStatus.GetValue(blackboard)) { return(Status.Running); } return(Status.Failure); } // Otherwise, if we succeed, throttle var status = Child.TickUpdate(blackboard); if (status != Status.Running && (status == ThrottleStatus.GetValue(blackboard) || Always.GetValue(blackboard))) { throttledUntil = DateTime.Now.Add(Time.GetValue(blackboard)); } return(Child.Status); }
protected override Status Update(Blackboard blackboard) { if (Func != null) { blackboard.Set(Destination, Func()); } else if (Value != null) { blackboard.Set(Destination, Value.GetValue(blackboard)); } else { blackboard.Set(Destination, FuncBlackboard(blackboard)); } return(Status.Success); }
protected override void OnInitialize(Blackboard blackboard) { waitUntil = DateTime.Now.Add(Time.GetValue(blackboard)); }
protected override void OnInitialize(Blackboard blackboard) { currentList = List.GetValue(blackboard).ToList(); currentIndex = 0; }
protected override void OnInitialize(Blackboard blackboard) { currentCount = Count.GetValue(blackboard); lastStatus = null; }
protected override void OnInitialize(Blackboard blackboard) { timeoutTime = DateTime.Now.Add(Timeout.GetValue(blackboard)); }