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