/// Execute the next action public void CompletedAction(ActionCompleteEvent item) { if (children.Any(x => x.action == item.action)) { resolved += 1; } if (resolved == total) { actions.Complete(this); } }
/// Run when an action is complete public void Complete(IAction action, bool success = true) { var evp = new ActionCompleteEvent() { action = action }; events.Trigger(evp); }
/// Execute the next action public void NextAction(ActionCompleteEvent item) { if (children.Count > 0) { if ((item == null) || (currentAction == item.action)) { currentAction = children.Dequeue(); actions.Execute(currentAction, NextAction); } } else { actions.Complete(this); } }