Esempio n. 1
0
 public void AddMission(MissionInstance mission)
 {
     currentMissions.Add(mission);
     mission.Finished += OnMissionFinished;
     mission.Changed  += OnMissionChange;
     hasChanged        = true;
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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;
        }