示例#1
0
        public void FloatConstructor(float x, float y)
        {
            //Arrange

            //Act
            Corner corner = new Corner(1, x, y);

            //Assert
            Assert.IsNotNull(corner);
            Assert.IsInstanceOf(typeof(Corner), corner);
            Assert.AreEqual(1, corner.GetID());
            Assert.AreEqual(x, corner.GetPoint().X);
            Assert.AreEqual(y, corner.GetPoint().Y);
        }
示例#2
0
文件: Room.cs 项目: Railec/SE1cKBS2
        /**
         * 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);
                }
            }
        }