Example #1
0
 protected override Status Update(Blackboard blackboard)
 {
     if (Child.TickUpdate(blackboard) != Status.Running)
     {
         return(FixedStatus.GetValue(blackboard));
     }
     return(Status.Running);
 }
Example #2
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     shouldRun = Predicate.GetValue(blackboard);
     if (Negate.GetValue(blackboard))
     {
         shouldRun = !shouldRun;
     }
 }
Example #3
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     if (Child == null)
     {
         resolvedTemplateName = TemplateName.GetValue(blackboard);
         Child = blackboard.InstanciateTemplate(resolvedTemplateName);
     }
 }
Example #4
0
        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);
        }
Example #5
0
 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);
 }
Example #6
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     waitUntil = DateTime.Now.Add(Time.GetValue(blackboard));
 }
Example #7
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     currentList  = List.GetValue(blackboard).ToList();
     currentIndex = 0;
 }
Example #8
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     currentCount = Count.GetValue(blackboard);
     lastStatus   = null;
 }
Example #9
0
 protected override void OnInitialize(Blackboard blackboard)
 {
     timeoutTime = DateTime.Now.Add(Timeout.GetValue(blackboard));
 }