Example #1
0
        public override LuaValue Execute(LuaTable enviroment, out bool isBreak)
        {
            //            LuaValue[] values = this.ExprList.ConvertAll(expr => expr.Evaluate(enviroment)).ToArray();
            List<LuaValue> values = new List<LuaValue>();
            foreach (var expr in this.ExprList)
                values.Add(expr.Evaluate(enviroment));

            LuaValue[] neatValues = LuaMultiValue.UnWrapLuaValues(values.ToArray());

            for (int i = 0; i < Math.Min(this.NameList.Count, neatValues.Length); i++)
            {
                enviroment.RawSetValue(this.NameList[i], neatValues[i]);
            }

            if (neatValues.Length < this.NameList.Count)
            {
                for (int i = neatValues.Length; i < this.NameList.Count - neatValues.Length; i++)
                {
                    enviroment.RawSetValue(this.NameList[i], LuaNil.Nil);
                }
            }

            isBreak = false;
            return null;
        }
Example #2
0
        public override LuaValue Execute(LuaTable enviroment, out bool isBreak)
        {
            LuaValue[] values     = ExprList.ConvertAll(expr => expr.Evaluate(enviroment)).ToArray();
            LuaValue[] neatValues = LuaMultiValue.UnWrapLuaValues(values);

            for (int i = 0; i < Math.Min(NameList.Count, neatValues.Length); i++)
            {
                enviroment.RawSetValue(NameList[i], neatValues[i]);
            }

            if (neatValues.Length < NameList.Count)
            {
                for (int i = neatValues.Length; i < NameList.Count - neatValues.Length; i++)
                {
                    enviroment.RawSetValue(NameList[i], LuaNil.Nil);
                }
            }

            isBreak = false;
            return(null);
        }
Example #3
0
        public override LuaValue Execute(LuaTable enviroment, out bool isBreak)
        {
            //[PixelCrushers]LuaValue[] values = this.ExprList.ConvertAll(expr => expr.Evaluate(enviroment)).ToArray();
            LuaValue[] values = LuaInterpreterExtensions.EvaluateAll(this.ExprList, enviroment).ToArray();

            LuaValue[] neatValues = LuaMultiValue.UnWrapLuaValues(values);

            for (int i = 0; i < Math.Min(this.NameList.Count, neatValues.Length); i++)
            {
                enviroment.RawSetValue(this.NameList[i], neatValues[i]);
            }

            if (neatValues.Length < this.NameList.Count)
            {
                for (int i = neatValues.Length; i < this.NameList.Count - neatValues.Length; i++)
                {
                    enviroment.RawSetValue(this.NameList[i], LuaNil.Nil);
                }
            }

            isBreak = false;
            return null;
        }
        public override LuaValue Execute(LuaTable enviroment, out bool isBreak)
        {
            //[PixelCrushers]LuaValue[] values = this.ExprList.ConvertAll(expr => expr.Evaluate(enviroment)).ToArray();
            LuaValue[] values = LuaInterpreterExtensions.EvaluateAll(this.ExprList, enviroment).ToArray();

            LuaValue[] neatValues = LuaMultiValue.UnWrapLuaValues(values);

            for (int i = 0; i < Math.Min(this.NameList.Count, neatValues.Length); i++)
            {
                enviroment.RawSetValue(this.NameList[i], neatValues[i]);
            }

            if (neatValues.Length < this.NameList.Count)
            {
                for (int i = neatValues.Length; i < this.NameList.Count - neatValues.Length; i++)
                {
                    enviroment.RawSetValue(this.NameList[i], LuaNil.Nil);
                }
            }

            isBreak = false;
            return(null);
        }
Example #5
0
        public override LuaValue Execute(LuaTable environment, out bool isBreak)
        {
            LuaValue[] values = ExprList.ConvertAll(expr => expr.Evaluate(environment)).ToArray();
            LuaValue[] neatValues = LuaMultiValue.UnWrapLuaValues(values);

            for (int i = 0; i < Math.Min(NameList.Count, neatValues.Length); i++)
            {
                environment.RawSetValue(NameList[i], neatValues[i]);
            }

            if (neatValues.Length < NameList.Count)
            {
                for (int i = neatValues.Length; i < NameList.Count - neatValues.Length; i++)
                {
                    environment.RawSetValue(NameList[i], LuaNil.Nil);
                }
            }

            isBreak = false;
            return null;
        }