public virtual IVisualElement Copy() { VisualPolygonalBuilding copy = new VisualPolygonalBuilding((IBuildingEntity)_buildingSource.Copy()); copy.CurrentFloor = copy.Floors[Floors.IndexOf(CurrentFloor)]; return(copy); }
public void RemoveFloor(Floor floor) { if (!Floors.Contains(floor)) { return; } var index = Floors.IndexOf(floor); Floors.Remove(floor); floor.Objects.CollectionChanged -= FloorObjectsCollectionChanged; floor.RemoveObjects(); if (index >= Floors.Count - 1) { CurrentFloor = Floors.LastOrDefault(); } else { CurrentFloor = Floors[index]; } foreach (var f in Floors) { f.RefreshTitle(); } evacuationPlan.ComposeRoutes(); }
public override IVisualElement Copy() { VisualRectangularBuilding copy = new VisualRectangularBuilding((IRectangularBuildingEntity)_rectangleSource.Copy()); copy.CurrentFloor = copy.Floors[Floors.IndexOf(CurrentFloor)]; return(copy); }
public Floor GetFloorBelow(Floor floor) { var index = Floors.IndexOf(floor); if (index < 1) { return(null); } else { return(Floors[index - 1]); } }