protected override void CopyFillInBaseProperties(IMapEntity copy, bool copyLocation = false) { base.CopyFillInBaseProperties(copy, copyLocation); IBuildingEntity copiedBuilding = (IBuildingEntity)copy; foreach (IFloorEntity floor in Floors) { copiedBuilding.Floors.Add((IFloorEntity)floor.Copy(copyLocation)); } }
public VisualPolygonalBuilding(IBuildingEntity mapEntity) : base() { _polygonBuildingSource = new VisualPolygon(mapEntity); _polygonBuildingSource.PropertyChanged += _polygonBuildingSource_PropertyChanged; // setup TerrainEnabled = false; _buildingSource = mapEntity; Floors = new ObservableCollection <VisualFloor>(); // Commands AddFloorCommand = new AddFloorCommand(this); // fill floors FillFromSource(); Floors.CollectionChanged += Floors_CollectionChanged; MapEntities = MapEntities; if (Floors.Count > 0) { CurrentFloor = Floors[0]; } }