RemoveObserver() public method

public RemoveObserver ( IObserver, observer ) : void
observer IObserver,
return void
コード例 #1
0
	/// <summary>
	/// call by a trigger when the user finish it
	/// </summary>
	/// <param name="subject">the trigger</param>
	public void Notify(BaseSubject subject)
	{
		if (subject is Trigger)
		{
			if (subject is MultipleChoiceTrigger)
			{
				MultipleChoiceTrigger trigger = (MultipleChoiceTrigger)subject;
				if (data.route.Waypoints.ContainsKey(trigger.ChoiceMade.Waypoint))
				{
					nextGoal = data.route.Waypoints[trigger.ChoiceMade.Waypoint];
				}
			}
			subject.RemoveObserver(this);
			executeNextCondition();
		}
		else if (subject is Download)
		{
			Download download = (Download)subject;
			if (download.theDownload.type == DownloadType.Direction)
			{
				UpdateDirection(Polyline.GetPolylineFromXML(download.lastDownload.text));
			}
		}
	}
コード例 #2
0
ファイル: MenuManager.cs プロジェクト: jodoudou/BROU_SVPRA
	public void Notify(BaseSubject subject)
	{
		if (subject is Download)
		{
			DownloadType type = ((Download)subject).theDownload.type;
			if (type == DownloadType.Attractions)
			{
				if (toolBox.data.attractions != null)
				{
					BuildMenuAttractions();
				}
				else
				{
					ActiveMenuAttraction(false);
					ActiveMainMenu(true);
					toolBox.loadingScreen.enable(false);
				}
			}
			else if (type == DownloadType.Route)
			{
				if (toolBox.data.route != null)
				{
					if (openRoute)
					{
						GotoNavigation();
					}
					else
					{
						save.SaveRoute();
						toolBox.data.eleRoute = null;
						ActiveOptionRoute(false);
					}
				}
				else
				{
					toolBox.loadingScreen.enable(false);
				}
			}
		}
		else if (subject is GPS)
		{
			subject.RemoveObserver(this);
			toolBox.download.EnqueueAttraction(toolBox.sensorManager.gps.currentPosition);
		}
	}