当前位置: 首页>>代码示例>>C#>>正文


C# CLS_Content.DepthAdd方法代码示例

本文整理汇总了C#中CSLE.CLS_Content.DepthAdd方法的典型用法代码示例。如果您正苦于以下问题:C# CLS_Content.DepthAdd方法的具体用法?C# CLS_Content.DepthAdd怎么用?C# CLS_Content.DepthAdd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSLE.CLS_Content的用法示例。


在下文中一共展示了CLS_Content.DepthAdd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            content.DepthAdd();
            ICLS_Expression expr_init = listParam[0] as ICLS_Expression;
            if (expr_init != null) expr_init.ComputeValue(content);//expr1

            ICLS_Expression expr_continue = listParam[1] as ICLS_Expression;
            ICLS_Expression expr_step = listParam[2] as ICLS_Expression;

            ICLS_Expression expr_block = listParam[3] as ICLS_Expression;
            CLS_Content.Value vrt = null;
            for (; ; )
            {
                if (expr_continue != null && !(bool)expr_continue.ComputeValue(content).value) break;//expr2

                if (expr_block != null)
                {
                    if (expr_block is CLS_Expression_Block)
                    {
                        var v = expr_block.ComputeValue(content);
                        if (v != null)
                        {
                            if (v.breakBlock > 2) vrt = v;
                            if (v.breakBlock > 1) break;
                        }
                    }
                    else
                    {
                        content.DepthAdd();
                        bool bbreak = false;
                        var v = expr_block.ComputeValue(content);
                        if (v != null)
                        {
                            if (v.breakBlock > 2) vrt = v;
                            if (v.breakBlock > 1) bbreak = true;
                        }
                        content.DepthRemove();
                        if (bbreak) break;
                    }
                    //if (v.breakBlock == 1) continue;
                    //if (v.breakBlock == 2) break;
                    //if (v.breakBlock == 10) return v;
                }

                if (expr_step != null)
                    expr_step.ComputeValue(content);//expr3
            }
            content.DepthRemove();
            content.OutStack(this);
            return vrt;
            //for 逻辑
            //做数学计算
            //从上下文取值
            //_value = null;
        }
开发者ID:lightszero,项目名称:cslightcore,代码行数:56,代码来源:CLS_Expression_LoopFor.cs

示例2: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            List<string> depth__;
            content.Record(out depth__);
            try
            {
                ICLS_Expression expr = listParam[0];
                if (expr is CLS_Expression_Block)
                {
                    expr.ComputeValue(content);
                }
                else
                {
                    content.DepthAdd();
                    expr.ComputeValue(content);
                    content.DepthRemove();
                }

            }
            catch (Exception err)
            {
                bool bParse = false;
                int i = 1;
                while (i < listParam.Count)
                {
                    CLS_Expression_Define def = listParam[i] as CLS_Expression_Define;
                    if (err.GetType()==(Type)def.value_type || err.GetType().IsSubclassOf((Type)def.value_type))
                    {
                        content.DepthAdd();
                        content.DefineAndSet(def.value_name, def.value_type, err);

                        listParam[i + 1].ComputeValue(content);
                        content.DepthRemove();
                        bParse = true;
                        break;
                    }
                    i += 2;
                }
                if (!bParse)
                {
                    throw err;
                }
            }
            content.Restore(depth__, this);
            //while((bool)expr_continue.value);

            //for 逻辑
            //做数学计算
            //从上下文取值
            //_value = null;
            content.OutStack(this);
            return null;
        }
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:54,代码来源:CLS_Expression_LoopTry.cs

示例3: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            ICLS_Expression expr_if = listParam[0];
            bool bif = (bool)expr_if.ComputeValue(content).value;
            //if (expr_init != null) expr_init.ComputeValue(content);
            ICLS_Expression expr_go1 = listParam[1];
            ICLS_Expression expr_go2 = null;
            if(listParam.Count>2)expr_go2= listParam[2];
            CLS_Content.Value value = null;
            if (bif && expr_go1 != null)
            {
                if (expr_go1 is CLS_Expression_Block)
                {
                    value = expr_go1.ComputeValue(content);
                }
                else
                {
                    content.DepthAdd();
                    value = expr_go1.ComputeValue(content);
                    content.DepthRemove();
                }

            }
            else if (!bif && expr_go2 != null)
            {

                if (expr_go2 is CLS_Expression_Block)
                {
                    value = expr_go2.ComputeValue(content);
                }
                else
                {
                    content.DepthAdd();
                    value = expr_go2.ComputeValue(content);
                    content.DepthRemove();
                }

            }

            //while((bool)expr_continue.value);

            //for 逻辑
            //做数学计算
            //从上下文取值
            //_value = null;
            content.OutStack(this);
            return value;
        }
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:49,代码来源:CLS_Expression_LoopIf.cs

示例4: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            content.DepthAdd();

            CLS_Content.Value vrt = null;

            CLS_Expression_Define define = listParam[0] as CLS_Expression_Define;
            define.ComputeValue(content);

            IEnumerator it = (listParam[1].ComputeValue(content).value as IEnumerable).GetEnumerator();

            ICLS_Expression expr_block = listParam[2];

            while (it.MoveNext())
            {
                content.Set(define.value_name, it.Current);

                if (expr_block != null)
                {
                    CLS_Content.Value v = expr_block.ComputeValue(content);
                    if (v != null)
                    {
                        if (v.breakBlock > 2)
                            vrt = v;
                        if (v.breakBlock > 1)
                            break;
                    }
                }
            }
            content.DepthRemove();
            content.OutStack(this);
            return vrt;
        }
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:34,代码来源:CLS_Expression_LoopForEach.cs

示例5: CreateDelegate

        public Delegate CreateDelegate(ICLS_Environment env, DeleFunction delefunc)
        {
            CLS_Content content = new CLS_Content(env);
            DeleFunction _func = delefunc;
            Action dele = () =>
            {

                content.DepthAdd();
                content.CallThis = _func.callthis;
                content.CallType = _func.calltype;
                content.function = _func.function;
                var func = _func.calltype.functions[_func.function];

                //content.DefineAndSet(function._paramnames[0], function._paramtypes[0].type, param0);

                func.expr_runtime.ComputeValue(content);
                content.DepthRemove();
            };
            Delegate d = dele as Delegate;
            if ((Type)this.type != typeof(Action))
            {
                return Delegate.CreateDelegate(this.type, d.Target, d.Method);
            }
            else
            {
                return dele;
            }
        }
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:28,代码来源:RegHelper_DeleAction.cs

示例6: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            content.DepthAdd();

            CLS_Content.Value vrt = null;

            ICLS_Expression expr_while = listParam[1];
            ICLS_Expression expr_block = listParam[0];

            do
            {
                if (expr_block != null)
                {
                    CLS_Content.Value v = expr_block.ComputeValue(content);
                    if (v != null)
                    {
                        if (v.breakBlock > 2)
                            vrt = v;
                        if (v.breakBlock > 1)
                            break;
                    }
                }
            } while ((bool)expr_while.ComputeValue(content).value);

            content.DepthRemove();
            content.OutStack(this);
            return vrt;
        }
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:29,代码来源:CLS_Expression_LoopDowhile.cs

示例7: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            content.DepthAdd();
            ICLS_Expression expr_while = listParam[1] as ICLS_Expression;
            ICLS_Expression expr_block = listParam[0] as ICLS_Expression;

            CLS_Content.Value vrt = null;
            do
            {
                if (expr_block != null)
                {
                    if (expr_block is CLS_Expression_Block)
                    {
                        var v = expr_block.ComputeValue(content);
                        if (v != null)
                        {
                            if (v.breakBlock > 2) vrt = v;
                            if (v.breakBlock > 1) break;
                        }
                    }
                    else
                    {
                        content.DepthAdd();
                        var v = expr_block.ComputeValue(content);
                        if (v != null)
                        {
                            if (v.breakBlock > 2) vrt = v;
                            if (v.breakBlock > 1) break;
                        }
                        content.DepthRemove();
                    }
                    //if (v.breakBlock == 1) continue;
                    //if (v.breakBlock == 2) break;
                    //if (v.breakBlock == 10) return v;
                }
            } while ((bool)expr_while.ComputeValue(content).value);
            content.DepthRemove();
            content.OutStack(this);
            return vrt;
            //for 逻辑
            //做数学计算
            //从上下文取值
            //_value = null;
        }
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:45,代码来源:CLS_Expression_LoopDowhile.cs

示例8: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            content.DepthAdd();
            ICLS_Expression expr_init = listParam[0] as ICLS_Expression;
            if (expr_init != null) expr_init.ComputeValue(content);

            ICLS_Expression expr_continue = listParam[1] as ICLS_Expression;
            ICLS_Expression expr_step = listParam[2] as ICLS_Expression;

            ICLS_Expression expr_block = listParam[3] as ICLS_Expression;

            for (; (bool)expr_continue.ComputeValue(content).value; expr_step.ComputeValue(content))
            {
                if (expr_block != null)
                {
                    if (expr_block is CLS_Expression_Block)
                    {
                        var v = expr_block.ComputeValue(content);
                        if (v != null && v.breakBlock > 1) break; ;
                    }
                    else
                    {
                        content.DepthAdd();
                        var v = expr_block.ComputeValue(content);
                        if (v != null && v.breakBlock > 1) break; ;
                        content.DepthRemove();
                    }
                    //if (v.breakBlock == 1) continue;
                    //if (v.breakBlock == 2) break;
                    //if (v.breakBlock == 10) return v;
                }
            }
            content.DepthRemove();
            content.OutStack(this);
            return null;
            //for 逻辑
            //做数学计算
            //从上下文取值
            //_value = null;
        }
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:41,代码来源:CLS_Expression_LoopFor.cs

示例9: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            content.DepthAdd();
            CLS_Expression_Define define = listParam[0] as CLS_Expression_Define;
            if (define == null)
            {

            }
            define.ComputeValue(content);

            System.Collections.IEnumerable emu = listParam[1].ComputeValue(content).value as System.Collections.IEnumerable;

            ICLS_Expression expr_block = listParam[2] as ICLS_Expression;

            var it = emu.GetEnumerator();
            while (it.MoveNext())
            {
                content.Set(define.value_name, it.Current);

                if (expr_block != null)
                {
                    var v = expr_block.ComputeValue(content);
                    if (v != null && v.breakBlock > 1) break; ;
                }
            }
            //ICLS_Expression expr_continue = listParam[1] as ICLS_Expression;
            //ICLS_Expression expr_step = listParam[2] as ICLS_Expression;

            //ICLS_Expression expr_block = listParam[3] as ICLS_Expression;

            //for (;(bool)expr_continue.ComputeValue(content).value; expr_step.ComputeValue(content))
            //{
            //    if(expr_block!=null)
            //    {
            //        var v = expr_block.ComputeValue(content);
            //        if (v != null && v.breakBlock > 1) break; ;
            //        //if (v.breakBlock == 1) continue;
            //        //if (v.breakBlock == 2) break;
            //        //if (v.breakBlock == 10) return v;
            //    }
            //}
            content.DepthRemove();
            content.OutStack(this);
            return null;
            //for 逻辑
            //做数学计算
            //从上下文取值
            //_value = null;
        }
开发者ID:jzgenius,项目名称:CSLightStudio,代码行数:50,代码来源:CLS_Expression_LoopForEach.cs

示例10: ComputeValue

 public CLS_Content.Value ComputeValue(CLS_Content content)
 {
     content.InStack(this);
     content.DepthAdd();
     CLS_Content.Value value = null;
     for (int i = 0, count = listParam.Count; i < count; i++)
     {
         value = listParam[i].ComputeValue(content);
         if (value != null && value.breakBlock != 0)
             break;
     }
     content.DepthRemove();
     content.OutStack(this);
     return value;
 }
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:15,代码来源:CLS_Expression_Block.cs

示例11: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            content.DepthAdd();
            CLS_Content.Value value = null;
            foreach (ICLS_Expression i in listParam)
            {
                ICLS_Expression e =i  as ICLS_Expression;
                if (e != null)
                    value =e.ComputeValue(content);

                if (value!=null&&value.breakBlock != 0) break;
            }
            content.DepthRemove();
            content.OutStack(this);
            return value;
        }
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:17,代码来源:CLS_Expression_Block.cs

示例12: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);

            CLS_Content.Value value = null;
            if ((bool)listParam[0].ComputeValue(content).value)
            {
                ICLS_Expression expr_block = listParam[1];
                if (expr_block != null)
                {
                    if (expr_block is CLS_Expression_Block)
                    {
                        value = expr_block.ComputeValue(content);
                    }
                    else
                    {
                        content.DepthAdd();
                        value = expr_block.ComputeValue(content);
                        content.DepthRemove();
                    }
                }
            }
            else if (listParam.Count > 2)
            {
                ICLS_Expression expr_elseif = listParam[2];
                if (expr_elseif != null)
                {
                    if (expr_elseif is CLS_Expression_Block)
                    {
                        value = expr_elseif.ComputeValue(content);
                    }
                    else
                    {
                        content.DepthAdd();
                        value = expr_elseif.ComputeValue(content);
                        content.DepthRemove();
                    }
                }
            }

            content.OutStack(this);
            return value;
        }
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:43,代码来源:CLS_Expression_LoopIf.cs

示例13: ComputeValue

        public CLS_Content.Value ComputeValue(CLS_Content content)
        {
            content.InStack(this);
            content.DepthAdd();

            CLS_Content.Value vrt = null;

            ICLS_Expression expr_init = listParam[0];
            ICLS_Expression expr_continue = listParam[1];
            ICLS_Expression expr_step = listParam[2];
            ICLS_Expression expr_block = listParam[3];

            if (expr_init != null)
                expr_init.ComputeValue(content);

            for (;;)
            {
                if (expr_continue != null && !(bool)expr_continue.ComputeValue(content).value)
                    break;

                if (expr_block != null)
                {
                    CLS_Content.Value v = expr_block.ComputeValue(content);
                    if (v != null)
                    {
                        if (v.breakBlock > 2)
                            vrt = v;
                        if (v.breakBlock > 1)
                            break;
                    }
                }

                if (expr_step != null)
                    expr_step.ComputeValue(content);
            }
            content.DepthRemove();
            content.OutStack(this);
            return vrt;
        }
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:39,代码来源:CLS_Expression_LoopFor.cs

示例14: CreateDelegate

        public Delegate CreateDelegate(ICLS_Environment env, DeleFunction delefunc)
        {
            DeleFunction _func = delefunc;
            Delegate _dele = delefunc.cacheFunction(null);
            if (_dele != null) return _dele;
            Action dele = () =>
            {
                var func = _func.calltype.functions[_func.function];
                if (func.expr_runtime != null)
                {
                    CLS_Content content = new CLS_Content(env);
                    try
                    {

                        content.DepthAdd();
                        content.CallThis = _func.callthis;
                        content.CallType = _func.calltype;
                        content.function = _func.function;

                        //content.DefineAndSet(function._paramnames[0], function._paramtypes[0].type, param0);

                        func.expr_runtime.ComputeValue(content);
                        content.DepthRemove();
                    }
                    catch (Exception err)
                    {
                        env.logger.Log(content.Dump());
                        throw err;
                    }
                }
            };
            Delegate d = dele as Delegate;
            if ((Type)this.type != typeof(Action))
            {
                _dele = Delegate.CreateDelegate(this.type, d.Target, d.Method);
            }
            else
            {
                _dele = dele;
            }
            return delefunc.cacheFunction(_dele);
        }
开发者ID:qq1792,项目名称:CSLightStudio,代码行数:42,代码来源:RegHelper_DeleAction.cs

示例15: CustomCoroutine

        IEnumerator CustomCoroutine(CLS_Content content)
        {
            content.InStack(this);
            content.DepthAdd();
            CLS_Content.Value retVal = null;
            ICLS_Expression exp = null;
            for (int i = 0, count = listParam.Count; i < count; i++)
            {
                exp = listParam[i];
                CLS_Expression_LoopFor expLoopFor = exp as CLS_Expression_LoopFor;
                if (expLoopFor != null)
                {
                    content.InStack(expLoopFor);
                    content.DepthAdd();

                    ICLS_Expression expr_init = expLoopFor.listParam[0];
                    ICLS_Expression expr_continue = expLoopFor.listParam[1];
                    ICLS_Expression expr_step = expLoopFor.listParam[2];
                    ICLS_Expression expr_block = expLoopFor.listParam[3];

            #if UNITY_EDITOR
                    try
                    {
            #endif
                    if (expr_init != null)
                        expr_init.ComputeValue(content);
            #if UNITY_EDITOR
                    }
                    catch (System.Exception ex) { content.environment.logger.Log_Error(ex.Message + "\n" + content.DumpStack() + ex); }
            #endif
                    for (;;)
                    {
            #if UNITY_EDITOR
                        try
                        {
            #endif
                        if (expr_continue != null && !(bool)expr_continue.ComputeValue(content).value)
                            break;
            #if UNITY_EDITOR
                        }
                        catch (System.Exception ex) { content.environment.logger.Log_Error(ex.Message + "\n" + content.DumpStack() + ex); }
            #endif
                        if (expr_block != null)
                        {
                            if (expr_block is CLS_Expression_Block)
                            {
                                content.InStack(expr_block);
                                content.DepthAdd();
                                for (int j = 0, count2 = expr_block.listParam.Count; j < count2; j++)
                                {
            #if UNITY_EDITOR
                                    try
                                    {
            #endif
                                    retVal = expr_block.listParam[j].ComputeValue(content);
            #if UNITY_EDITOR
                                    }
                                    catch (System.Exception ex) { content.environment.logger.Log_Error(ex.Message + "\n" + content.DumpStack() + ex); }
            #endif
                                    if (retVal != null)
                                    {
                                        if (retVal.breakBlock == 12)
                                        {
                                            CLS_Content.PoolContent(content);
                                            yield break;
                                        }
                                        else if (retVal.breakBlock == 13)
                                            yield return retVal.value;
                                        else if (retVal.breakBlock > 1)
                                            break;
                                    }
                                }
                                content.DepthRemove();
                                content.OutStack(expr_block);
                            }
                            else
                            {
            #if UNITY_EDITOR
                                try
                                {
            #endif
                                retVal = expr_block.ComputeValue(content);
            #if UNITY_EDITOR
                                }
                                catch (System.Exception ex) { content.environment.logger.Log_Error(ex.Message + "\n" + content.DumpStack() + ex); }
            #endif
                                if (retVal != null)
                                {
                                    if (retVal.breakBlock == 12)
                                    {
                                        CLS_Content.PoolContent(content);
                                        yield break;
                                    }
                                    else if (retVal.breakBlock == 13)
                                        yield return retVal.value;
                                    else if (retVal.breakBlock > 1)
                                        break;
                                }
                            }
                        }
//.........这里部分代码省略.........
开发者ID:wpszz,项目名称:CSLightForUnity,代码行数:101,代码来源:CLS_Expression_Coroutine.cs


注:本文中的CSLE.CLS_Content.DepthAdd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。