private void SetMap(IMap_Base newMap, IMap_Observer observer) { if (observer.Map != null) { observer.Map.HeightChanged -= observer.HeightChanged; observer.Map.SelectedTileChanged -= observer.SelectedTileChanged; } observer.Map = newMap; if (newMap != null) { newMap.HeightChanged += observer.HeightChanged; newMap.SelectedTileChanged += observer.SelectedTileChanged; } foreach (string key in observer.MoreObservers.Keys) { SetMap(newMap, observer.MoreObservers[key]); } }
public void SetMap(IMap_Base map) { var maps = new IMap_Observer[] { TopRmpView.TopViewControl, TopRmpView.RouteViewControl, TileView.TileViewControl, RmpView.RouteViewControl, TopView.TopViewControl }; foreach (var f in maps) { if (f != null) { SetMap(map, f); } } MapViewPanel.Instance.MapView.Refresh(); }
public void SetMap(IMap_Base newMap, IMap_Observer observer) { if (observer.Map != null) { observer.Map.HeightChanged -= new HeightChangedDelegate(observer.HeightChanged); observer.Map.SelectedTileChanged -= new SelectedTileChangedDelegate(observer.SelectedTileChanged); } observer.Map = newMap; if (newMap != null) { newMap.HeightChanged += new HeightChangedDelegate(observer.HeightChanged); newMap.SelectedTileChanged += new SelectedTileChangedDelegate(observer.SelectedTileChanged); } foreach (string key in observer.MoreObservers.Keys) SetMap(newMap, observer.MoreObservers[key]); }