public StackObjectBoolean(StackObjectBoolean x)
 {
     this.value = x.value;
 }
Пример #2
0
 /// <summary>
 /// Sets a variable. Certain variables should not be changed until set.
 /// So it copies them.
 /// </summary>
 /// <param name="varName"></param>
 public void SetVariable(string varName)
 {
     #region Creates a copy of certain types of Variables.
     if (stack.Peek() is StackObjectBoolean)
     {
         variables[varName] = new StackObjectBoolean(((StackObjectBoolean)stack.Peek()));
     }
     else
     if (stack.Peek() is StackObjectNumber)
     {
         variables[varName] = new StackObjectNumber(((StackObjectNumber)stack.Peek()));
     }
     else
     if (stack.Peek() is StackObjectString)
     {
         variables[varName] = new StackObjectString(((StackObjectString)stack.Peek()));
     }
     #endregion
     else
     {
         variables[varName] = stack.Peek();
     }
 }
Пример #3
0
        private void BuildStackBoolean()
        {
            StackObjectBoolean b = new StackObjectBoolean((bool)variablesToBuild.Peek()["Value"]);
            buildStack.Push(b);

            currentClass.Pop();
            variablesToBuild.Pop();
        }