protected override Status OnExecute(Blackboard bb) { if (Count == 0) { return(Status.Error); } bb.Get <int>(Id, "i", out int i); if (i < N) { var status = this[0].Execute(bb); if (status == Status.Success) { i++; bb.Set(Id, "i", i); return(Status.Running); } return(status); } return(Status.Success); }
protected override Status OnExecute(Blackboard bb) { int start = 0; if (bb.Get(Id, "#", out object iter)) { start = (int)iter; } for (int i = start; i < Count; ++i) { var status = this[i].Execute(bb); if (status != Status.Success) { if (status == Status.Running) { bb.Set(Id, "#", i); } return(status); } } return(Status.Success); }
protected override void OnOpen(Blackboard bb) { bb.Set(Id, "#", 0); }
protected override void OnOpen(Blackboard bb) { bb.Set(Id, "alarm", DateTime.Now.AddMilliseconds(Milliseconds)); }