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); }
/** * 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); } } }