public void AddMission(MissionInstance mission) { currentMissions.Add(mission); mission.Finished += OnMissionFinished; mission.Changed += OnMissionChange; hasChanged = true; }
public object Clone() { MissionInstance mission = new MissionInstance(); mission.currentMission = (MissionNode)currentMission.Clone(); mission.missionId = missionId; if (mission.currentMission != null) { mission.currentMission.Success += mission.OnSuccess; } return(mission); }
public void OnMissionFinished(object sender, EventArgs args) { if (!(sender is MissionInstance)) { return; } MissionInstance finishedMission = (MissionInstance)sender; Console.WriteLine("Mission {0} finished", finishedMission.CurrentMission.Title); NotificationPopup.GetInstance().AddNotification(string.Format("Mission {0} finished", finishedMission.CurrentMission.Title)); //TODO: Pazymeti misija kaip pabaigta, kad negaletu vel pridet missionsToRemove.Enqueue(finishedMission.MissionId); }
public void OnMissionChange(object sender, EventArgs args) { if (!(sender is MissionInstance)) { return; } MissionInstance mission = (MissionInstance)sender; DialogueInfo dialogueInfo = mission.CurrentMission.NewDialogueOption; if (dialogueInfo != null) { IChattable npc = EntityService.GetInstance().GetNpcById(dialogueInfo.NpcId); DialogueManager.GetInstance().AssignNewDialogue(dialogueInfo); } NotificationPopup.GetInstance().AddNotification(string.Format("Mission log updated")); hasChanged = true; }