本文整理汇总了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]);
}
示例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]);
}
示例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);
}
}
}
示例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);
}
}
示例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]);
}
示例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);
}