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


C# ScriptProcessor.CreateBool方法代码示例

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


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

示例1: ToBool

 internal override SBool ToBool(ScriptProcessor processor)
 {
     return processor.CreateBool(Value != 0);
 }
开发者ID:Aragas,项目名称:Pokemon3D-1,代码行数:4,代码来源:SNumber.cs

示例2: Includes

        public static SObject Includes(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters)
        {
            if (parameters.Length >= 1)
            {
                var str = instance as SString;
                var includes = parameters[0].ToString(processor);

                return processor.CreateBool(str.Value.Contains(includes.Value));
            }

            return processor.Undefined;
        }
开发者ID:nilllzz,项目名称:Pokemon3D,代码行数:12,代码来源:StringPrototype.cs

示例3: ToBool

 internal override SBool ToBool(ScriptProcessor processor)
 {
     return processor.CreateBool(false);
 }
开发者ID:Aragas,项目名称:Pokemon3D-1,代码行数:4,代码来源:SUndefined.cs

示例4: StartsWith

        public static SObject StartsWith(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters)
        {
            if (TypeContract.Ensure(parameters, typeof(SString)))
            {
                var str = instance as SString;
                var includes = parameters[0] as SString;

                if (includes.Value == "")
                    return processor.CreateBool(str.Value == "");

                return processor.CreateBool(str.Value.StartsWith(includes.Value));
            }

            return processor.Undefined;
        }
开发者ID:nilllzz,项目名称:Pokemon3D,代码行数:15,代码来源:StringPrototype.cs

示例5: TranslateBool

 private static SObject TranslateBool(ScriptProcessor processor, bool boolIn)
 {
     return processor.CreateBool(boolIn);
 }
开发者ID:nilllzz,项目名称:Pokemon3D,代码行数:4,代码来源:ScriptInAdapter.cs

示例6: Includes

        public static SObject Includes(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters)
        {
            if (parameters.Length == 1)
            {
                var arr = (SArray)instance;
                var compare = parameters[0];

                return processor.CreateBool(arr.ArrayMembers.Any(m => ObjectComparer.LooseEquals(processor, m, compare)));
            }

            if (parameters.Length >= 2)
            {
                var arr = (SArray)instance;
                var compare = parameters[0];
                var comparer = (SFunction)Unbox(parameters[1]);

                return processor.CreateBool(arr.ArrayMembers.Any(m => ((SBool)comparer.Call(processor, This, This, new[] { m, compare })).Value));
            }

            return processor.Undefined;
        }
开发者ID:nilllzz,项目名称:Pokemon3D,代码行数:21,代码来源:ArrayPrototype.cs

示例7: All

        public static SObject All(ScriptProcessor processor, SObject instance, SObject This, SObject[] parameters)
        {
            if (parameters.Length >= 1)
            {
                var arr = (SArray)instance;
                var comparer = (SFunction)Unbox(parameters[0]);
                
                var result = arr.ArrayMembers.All(m => ((SBool)comparer.Call(processor, This, This, new[] { m })).Value);
                return processor.CreateBool(result);
            }

            return processor.Undefined;
        }
开发者ID:nilllzz,项目名称:Pokemon3D,代码行数:13,代码来源:ArrayPrototype.cs

示例8: ToBool

 /// <summary>
 /// Returns the bool representation of this object.
 /// </summary>
 internal virtual SBool ToBool(ScriptProcessor processor)
 {
     return processor.CreateBool(true);
 }
开发者ID:nilllzz,项目名称:Pokemon3D,代码行数:7,代码来源:SObject.cs


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