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


C# Boolean.GetLength方法代码示例

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


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

示例1: GlyphPart

        public GlyphPart(Boolean[,] raw)
            : this()
        {
            if (raw.GetLength(0) != 3 || raw.GetLength(1) != 3)
                throw new ArgumentException("Expecting a 3x3 boolean array");

            data = Rotate(raw);
        }
开发者ID:jluchiji,项目名称:journey-glyph-generator,代码行数:8,代码来源:GlyphPart.cs

示例2: CalculateCollisionPixeslForTextureSheetCell

 public static Point[] CalculateCollisionPixeslForTextureSheetCell(Boolean[,] collisionBooleans)
 {
     List<Point> collisionPointsList = new List<Point>();
     for (Int32 x = 0; x < collisionBooleans.GetLength(0); x++) {
         for (Int32 y = 0; y < collisionBooleans.GetLength(1); y++) {
             if (collisionBooleans[x, y]) {
                 collisionPointsList.Add(new Point(x, y));
             }
         }
     }
     return collisionPointsList.ToArray();
 }
开发者ID:bstockus,项目名称:WarehouseZombieAttack,代码行数:12,代码来源:TextureHelper.cs

示例3: Convert

 public static Texture2D Convert(GraphicsDevice device, Boolean[,] arrayToConvert)
 {
     // create a 1D array of colors so that we can turn the array into a Texture;
     int aWidth = arrayToConvert.GetLength(0);
     int aLength = arrayToConvert.GetLength(1);
     Color[] colorArray = new Color[aLength * aWidth];
     for (int x = 0; x < aWidth; x++)
     {
         for (int y = 0; y < aLength; y++)
         {
             if (arrayToConvert[x, y]) colorArray[x + (y * aLength)] = Color.Black;
             else colorArray[x + (y * aLength)] = Color.White;
         }
     }
     Texture2D mazeTexture = new Texture2D(device, aWidth, aLength, false, SurfaceFormat.Color);
     mazeTexture.SetData(colorArray);
     return mazeTexture;
 }
开发者ID:sevvy325,项目名称:Maze,代码行数:18,代码来源:ArraytoTex.cs


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