コード例 #1
0
ファイル: LocalVar.cs プロジェクト: pavlik-y/Scratch
        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;
        }
コード例 #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);
        }
コード例 #3
0
ファイル: LocalVar.cs プロジェクト: farreltr/OneLastSunset
        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;
        }
コード例 #4
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);
        }
コード例 #5
0
ファイル: Chunk.cs プロジェクト: rhinohq/A2-Computing-Project
        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;
        }