public List<CompositeNode> GetAllChildrenNodes(CompositeNode fatherNode) { var dependentNodes = Edges.Where(e => e.StartingNode == fatherNode).Select(e => e.EndingNode); if (dependentNodes != null) { return dependentNodes.ToList(); } else return null; }
public override void Handle(CompositeNodeStateType type, CompositeNode node) { if (type == CompositeNodeStateType.Completed) { Console.WriteLine("Node state changed to Completed"); node.State = new CompletedState(); } else Console.WriteLine("Invalid State"); }
private void Subscribe(CompositeNode node) { node.Event += node_Event; }
public bool VerifyFatherState(CompositeNode childrenNode) { bool fathersCompleted = true; var FatherNodes = Edges.Where(e => e.EndingNode == childrenNode).Select(e => e.StartingNode).ToList(); foreach (var node in FatherNodes) { if (node.State.GetType() != typeof(CompletedState)) { fathersCompleted = false; break; } } return fathersCompleted; }
public override void Handle(CompositeNodeStateType type, CompositeNode node) { Console.WriteLine("Node job is completed"); }
public abstract void Handle(CompositeNodeStateType type, CompositeNode node);