示例#1
0
 //constructor for logic nodes
 public Node(ICalculationStrategy strategy)
 {
     CalculationStrategy = strategy;
     Parents             = new List <NodeBase>();
     Children            = new List <NodeBase>();
     State    = new UnreadyState(this);
     _visitor = new NodeVisitor();
 }
示例#2
0
 //constructor for input nodes
 public Node()
 {
     Parents   = new List <NodeBase>();
     Children  = new List <NodeBase>();
     State     = new UnreadyState(this);
     _calledBy = new List <NodeBase>();
     _visitor  = new NodeVisitor();
 }
示例#3
0
 public override void SetChildrenStates()
 {
     State = new UnreadyState(this);
     if (Parents.Count > 0)
     {
         Output = null;
     }
     foreach (NodeBase node in Children)
     {
         node.SetChildrenStates();
     }
 }