Пример #1
0
        public override DHJassValue GetResult()
        {
            if (command != null)
            {
                if (index == null)
                {
                    DHJassValue variable = command.GetResult();
                    variable.SetValue(value.GetResult());

                    if (DHJassExecutor.IsTracing && variable.Name.StartsWith(DHJassExecutor.TraceName))
                    {
                        string strValue = "";

                        if (variable is DHJassInt && variable.IntValue != 0)
                        {
                            strValue = (variable as DHJassInt).IDValue + "/";
                        }

                        strValue += variable.Value;

                        Console.WriteLine("Called Set " + variable.Name + "=" + strValue);
                    }
                }
                else
                {
                    DHJassArray array  = command.GetResult() as DHJassArray;
                    DHJassValue jIndex = index.GetResult();
                    DHJassValue jValue = value.GetResult();

                    if (DHJassExecutor.IsTracing && array.Name.StartsWith(DHJassExecutor.TraceName))
                    {
                        string strValue = "";

                        if (jValue is DHJassInt && jValue.IntValue != 0)
                        {
                            strValue = (jValue as DHJassInt).IDValue + "/";
                        }

                        strValue += jValue.Value;

                        Console.WriteLine("Called Set " + array.Name + "[" + jIndex.IntValue + "]=" + strValue);
                    }

                    array.SetElementValue(jIndex.IntValue, jValue);
                }
            }

            return(null);
        }
Пример #2
0
        public override DHJassValue GetResult()
        {
            DHJassValue copy = variable.GetNew();

            copy.Name = name;
            copy.SetValue(value.GetResult());

            return(copy);
        }
Пример #3
0
 public override DHJassValue GetResult()
 {
     if (command == null)
     {
         if (!TryParseCode(code, out command))
         {
             command = new DHJassPassValueCommand(new DHJassUnusedType());
         }
     }
     return(command.GetResult());
 }
Пример #4
0
        public override DHJassValue GetResult()
        {
            DHJassValue operand1 = a.GetResult();

            switch (operation)
            {
            case AnyOperation.AND:
                if (operand1.BoolValue == false)
                {
                    return(new DHJassBoolean(null, false));
                }
                break;

            case AnyOperation.OR:
                if (operand1.BoolValue == true)
                {
                    return(new DHJassBoolean(null, true));
                }
                break;
            }

            DHJassValue operand2 = (b != null) ? b.GetResult() : null;

            switch (operation)
            {
            case AnyOperation.Add:
                return(operand1.Add(operand2));

            case AnyOperation.Subtract:
                return(operand1.Subtract(operand2));

            case AnyOperation.Multiply:
                return(operand1.Multiply(operand2));

            case AnyOperation.Divide:
                return(operand1.Divide(operand2));

            case AnyOperation.AND:
                return(operand1.And(operand2));

            case AnyOperation.OR:
                return(operand1.Or(operand2));

            case AnyOperation.Less:
                return(operand1.Less(operand2));

            case AnyOperation.LessOrEqual:
                return(operand1.LessOrEqual(operand2));

            case AnyOperation.Greater:
                return(operand1.Greater(operand2));

            case AnyOperation.GreaterOrEqual:
                return(operand1.GreaterOrEqual(operand2));

            case AnyOperation.Equal:
                return(operand1.Equals(operand2));

            case AnyOperation.NotEqual:
                return(operand1.NotEquals(operand2));

            case AnyOperation.Not:
                return(operand1.Not());

            default:
                return(new DHJassUnusedType());
            }
        }
Пример #5
0
 public override DHJassValue GetResult()
 {
     return(command.GetResult());
 }