Example #1
0
 public override Tuple <bool, double> CalcOutput()
 {
     if (notNode != null && orNode != null)
     {
         var savedOutput = notNode.CalcOutput();
         //since the node needs 2 nodes to calculate its output we will remove one standard delay
         savedOutput = new Tuple <bool, double>(savedOutput.Item1, savedOutput.Item2 + this.Delay);
         if (components.OfType <VisualComponent>().Any())
         {
             components.OfType <VisualComponent>().FirstOrDefault().SavedOutput = savedOutput;
         }
         return(savedOutput);
     }
     return(new Tuple <bool, double>(false, 15));
 }
Example #2
0
        public override Tuple <bool, double> CalcOutput()
        {
            if (one != null && two != null)
            {
                var savedOutput = two.CalcOutput();
                //since the node contains 2 subnodes we need to remove one delay
                savedOutput = new Tuple <bool, double>(savedOutput.Item1, savedOutput.Item2 + this.Delay);
                if (components.OfType <VisualComponent>().Any())
                {
                    components.OfType <VisualComponent>().FirstOrDefault().SavedOutput = savedOutput;
                }
                return(savedOutput);
            }

            return(null);
        }