/// <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)); } } }
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); } }