Exemple #1
0
        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();
        }