コード例 #1
0
        /// <summary>
        /// This method will go through the inputs, and determine if each node needs further evaluation.
        /// If not then we will fill the result stack and get ready for expression evaluation
        /// </summary>
        /// <param name="connectedBlock"></param>
        /// <returns></returns>
        public override bool EvaluateInternalData(BaseNodeBlock connectedBlock)
        {
            Console.WriteLine(String.Format("From {0} -> {1}", this.GetType().Name, connectedBlock.GetType().Name));
            bool temp = true;

            if (connectedBlock is GetConstantNodeBlock block)
            {
                ResultsStack.Push(block?.InternalData.VarData);
                Console.WriteLine(String.Format("Result: {0}", ResultsStack.Peek()));
                return(true);
            }
            else
            {
                if (connectedBlock.AnswerToOutput != null)
                {
                    ResultsStack.Push(connectedBlock.AnswerToOutput);
                    Console.WriteLine(String.Format("Result: {0}", ResultsStack.Peek()));
                    connectedBlock.AnswerToOutput = null;
                }
                else
                {
                    temp &= connectedBlock.OnStartEvaluateInternalData();                     //it's not a constant thus we MUST evaluate this node.
                    if (temp)
                    {
                        this.ResultsStack.Push(connectedBlock.AnswerToOutput);
                        Console.WriteLine(String.Format("Result: {0}", ResultsStack.Peek()));
                        connectedBlock.AnswerToOutput = null;
                    }
                }
            }

            return(temp);
        }
コード例 #2
0
 /// <summary>
 /// NA Do not use
 /// </summary>
 /// <param name="currentNB"></param>
 public override void OnEndNodeBlockExecution(ref BaseNodeBlock currentNB)
 {
     throw new NotImplementedException();
 }
コード例 #3
0
 /// <summary>
 /// NA DO NOT USE
 /// </summary>
 /// <param name="currentNB"></param>
 /// <returns></returns>
 public override bool OnStartNodeBlockExecution(ref BaseNodeBlock currentNB)
 {
     throw new NotImplementedException();
 }