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


C# Corner.GetWalls方法代码示例

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


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

示例1: DoorAddWall

        public void DoorAddWall()
        {
            //Arrange
            Corner left = new Corner(new PointF(0, 0));
            Corner right = new Corner(new PointF(10, 0));
            Door door = new Door(left, right);

            //Act
            left.AddWall(door);
            right.AddWall(door);

            //Assert
            IList lWalls = left.GetWalls();
            Assert.AreEqual(1, lWalls.Count);
            Assert.IsInstanceOf<Door>(lWalls[0]);
            Assert.AreEqual(door, lWalls[0]);
        }
开发者ID:Railec,项目名称:SE1cKBS2,代码行数:17,代码来源:CornerTest.cs

示例2: MixedAddWalls

        public void MixedAddWalls()
        {
            //Arrange
            Corner corn1 = new Corner(new PointF(0, 0));
            Corner corn2 = new Corner(new PointF(10, 0));
            Corner corn3 = new Corner(new PointF(10, 10));
            Wall wall = new Wall(corn1, corn2);
            Door door = new Door(corn2, corn3);

            //Act
            corn2.AddWalls(wall, door);

            //Assert
            IList lWalls = corn2.GetWalls();
            Assert.AreEqual(2, lWalls.Count);
            Assert.AreEqual(wall, lWalls[0]);
            Assert.AreEqual(door, lWalls[1]);
        }
开发者ID:Railec,项目名称:SE1cKBS2,代码行数:18,代码来源:CornerTest.cs

示例3: GetOutline

        /**
         * This method is a recurisve method to find the outline of a room through connecting corners.
         * The output can be found in the points param.
         */
        private void GetOutline(List<PointF> points, Corner corner, List<Wall> excludes = null)
        {
            if(excludes == null) excludes = new List<Wall>();

            points.Add(corner.GetPoint());
            foreach(Wall wall in corner.GetWalls()) {
                Corner nextCorner = (wall.Left == corner ? wall.Right : wall.Left);

                if(!excludes.Contains(wall) && this._corners.Contains(nextCorner)) {
                    excludes.Add(wall);
                    GetOutline(points, nextCorner, excludes);
                }
            }
        }
开发者ID:Railec,项目名称:SE1cKBS2,代码行数:18,代码来源:Room.cs

示例4: DeleteCorner

 /**
  * This method deletes a corner from the blueprint.
  * All walls that connect to this corner will also be deleted.
  */
 public void DeleteCorner(Corner delCorner)
 {
     Wall[] copy = ((List<Wall>)delCorner.GetWalls()).ToArray();
     this.DeleteWall(copy);
     foreach(Room room in this.Rooms) {
         room.GetCorners().Remove(delCorner);
     }
 }
开发者ID:Railec,项目名称:SE1cKBS2,代码行数:12,代码来源:Blueprint.cs

示例5: NullAddWalls

        public void NullAddWalls()
        {
            //Arrange
            Corner corn1 = new Corner(new PointF(0, 0));
            Corner corn2 = new Corner(new PointF(10, 0));
            Corner corn3 = new Corner(new PointF(10, 10));
            Wall wall1 = new Wall(corn1, corn2);
            Wall wall2 = null;

            //Act
            corn2.AddWalls(wall2, wall1);

            //Assert
            IList lWalls = corn2.GetWalls();
            Assert.AreEqual(1, lWalls.Count);
            Assert.AreEqual(wall1, lWalls[0]);
        }
开发者ID:Railec,项目名称:SE1cKBS2,代码行数:17,代码来源:CornerTest.cs

示例6: NullAddWall

        public void NullAddWall()
        {
            //Arrange
            Corner left = new Corner(new PointF(0, 0));
            Corner right = new Corner(new PointF(10, 0));
            Wall wall = null;

            //Act
            left.AddWall(wall);
            right.AddWall(wall);

            //Assert
            IList lWalls = left.GetWalls();
            Assert.AreEqual(0, lWalls.Count);
        }
开发者ID:Railec,项目名称:SE1cKBS2,代码行数:15,代码来源:CornerTest.cs


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