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


C# ScriptCoreLib.SelectMany方法代码示例

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


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

示例1: InvokeTest

        public static void InvokeTest(Action<string> WriteLine)
        {
            var Enumerable_Range_1_2 = new[] { 1, 2 }.AsEnumerable();
            var Enumerable_Range_3_2 = new[] { 3, 4 }.AsEnumerable();


            foreach (var item in

                Enumerable_Range_1_2

                .SelectMany(
                    x =>
                    {
                        WriteLine("SelectMany " + new { x });

                        return Enumerable_Range_3_2.Select(
                            y =>
                            {
                                WriteLine("Select " + new { x, y });

                                return new { x, y };
                            }
                        );
                    }
                )

                // jsc should call it automatically to allow arrays
                .AsEnumerable()

                )
            {
                WriteLine(item.ToString());
            }
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:34,代码来源:Application.cs

示例2: Application


//.........这里部分代码省略.........
                               x.style.height = "96px";
                           }
                       ),
                       Message = "Face Value by mshariful"
                   }
                 );



            add(
                   new NotificationLayout
                   {
                       // keep attributes around?
                       // like we do with XElement sync?
                       Icon = new HTML.Images.FromAssets._371_28122014_2045510F2F7974319A9F7E9F4B39DF07().With(
                           x =>
                           {
                               x.style.width = "96px";
                               x.style.height = "96px";
                           }
                       ),
                       Message = "Mind Wall. by Sumit Goski"
                   }
                 );


            #region lines
            {
                var geometry = new THREE.Geometry
                {
                    // how can we keep streaming verticies data points to gpu?
                    vertices =

                        others.SelectMany(
                            lineTo =>
                                new[]
                                {
                                    new THREE.Vector3(200, 0, 0),
                                    lineTo.sprite.position
                                }
                        ).ToArray()

                    // https://github.com/mrdoob/three.js/wiki/Updates
                    // http://stackoverflow.com/questions/17842521/adding-geometry-to-a-three-js-mesh-after-render
                    //verticesNeedUpdate = true
                };

                Native.window.onframe += delegate { geometry.verticesNeedUpdate = true; };

                var o = new THREE.Line(geometry, new THREE.LineDashedMaterial(
                    new { color = 0x00aaff, dashSize = 1, gapSize = 0.5, linewidth = 1 }
                    ), THREE.LineStrip);

                //objects.Add(o);
                scene.add(o);
            }
            #endregion


            //          // DK2
            //          hResolution: 1920,
            //vResolution: 1080,

            var renderer = new THREE.WebGLRenderer();
            renderer.setSize(1920, 1080);
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:66,代码来源:Application.cs

示例3: hilbert3D

        // var points = hilbert3D( new THREE.Vector3( 0,0,0 ), 25.0, recursion, 0, 1, 2, 3, 4, 5, 6, 7 );
        static THREE.Vector3[] hilbert3D(
            THREE.Vector3 center,
            double size = 25.0,
            int iterations = 1,
            int v0 = 0,
            int v1 = 1,
            int v2 = 2,
            int v3 = 3,
            int v4 = 4,
            int v5 = 5,
            int v6 = 6,
            int v7 = 7)
        {
            // 0:71ms {{ i = 0, x = -18.75, y = 18.75, z = -18.75 }}

            // Default Vars
            var half = size / 2;


            var vec_s = new[] {
                new THREE.Vector3(center.x - half, center.y + half, center.z - half),
                new THREE.Vector3(center.x - half, center.y + half, center.z + half),
                new THREE.Vector3(center.x - half, center.y - half, center.z + half),
                new THREE.Vector3(center.x - half, center.y - half, center.z - half),
                new THREE.Vector3(center.x + half, center.y - half, center.z - half),
                new THREE.Vector3(center.x + half, center.y - half, center.z + half),
                new THREE.Vector3(center.x + half, center.y + half, center.z + half),
                new THREE.Vector3(center.x + half, center.y + half, center.z - half)
            };

            var vec = new[] {
                vec_s[v0],
                vec_s[v1],
                vec_s[v2],
                vec_s[v3],
                vec_s[v4],
                vec_s[v5],
                vec_s[v6],
                vec_s[v7]
            };

            // Recurse iterations

            //if (--iterations >= 0)
            if (iterations > 0)
            {
                iterations--;

                var tmp = new[] {
                    hilbert3D(vec[0], half, iterations, v0, v3, v4, v7, v6, v5, v2, v1),
                    hilbert3D(vec[1], half, iterations, v0, v7, v6, v1, v2, v5, v4, v3),
                    hilbert3D(vec[2], half, iterations, v0, v7, v6, v1, v2, v5, v4, v3),
                    hilbert3D(vec[3], half, iterations, v2, v3, v0, v1, v6, v7, v4, v5),
                    hilbert3D(vec[4], half, iterations, v2, v3, v0, v1, v6, v7, v4, v5),
                    hilbert3D(vec[5], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7),
                    hilbert3D(vec[6], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7),
                    hilbert3D(vec[7], half, iterations, v6, v5, v2, v1, v0, v3, v4, v7)
                };

                // Return recursive call
                return tmp.SelectMany(x => x).ToArray();
            }

            // Return complete Hilbert Curve.
            return vec;
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:67,代码来源:Application.cs


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