Inheritance: Runtime.Object, INamedContent
Exemplo n.º 1
0
 public Element(PushPopType type, Container container, int contentIndex, bool inExpressionEvaluation = false) {
     this.currentContainer = container;
     this.currentContentIndex = contentIndex;
     this.inExpressionEvaluation = inExpressionEvaluation;
     this.temporaryVariables = new Dictionary<string, Object>();
     this.type = type;
 }
Exemplo n.º 2
0
        internal void StartExternalFunctionEvaluation (Container funcContainer, params object[] arguments)
        {
            // We'll start a new callstack, so keep hold of the original,
            // as well as the evaluation stack so we know if the function 
            // returned something
            _originalCallstack = callStack;
            _originalEvaluationStackHeight = evaluationStack.Count;

            // Create a new base call stack element.
            callStack = new CallStack (funcContainer);
            callStack.currentElement.type = PushPopType.Function;

            // By setting ourselves in external function evaluation mode,
            // we're saying it's okay to end the flow without a Done or End,
            // but with a ~ return instead.
            _isExternalFunctionEvaluation = true;

            // Pass arguments onto the evaluation stack
            if (arguments != null) {
                for (int i = 0; i < arguments.Length; i++) {
                    if (!(arguments [i] is int || arguments [i] is float || arguments [i] is string)) {
                        throw new System.ArgumentException ("ink arguments when calling EvaluateFunction must be int, float or string");
                    }

                    evaluationStack.Add (Runtime.Value.Create (arguments [i]));
                }
            }
        }
Exemplo n.º 3
0
        public CallStack (Container rootContentContainer)
        {
            _threads = new List<Thread> ();
            _threads.Add (new Thread ());

            _threads [0].callstack.Add (new Element (PushPopType.Tunnel, rootContentContainer, 0));
        }