Exemple #1
0
        public Quest GetRootQuest(IQuest reference)
        {
            IQuest quest = this.GetQuest(reference.uniqueID);

            while (!quest.IsQuestRoot())
            {
                quest = this.GetQuest(quest.parent.uniqueID);
            }

            return((Quest)quest);
        }
Exemple #2
0
        // PROTECTED METHODS: ---------------------------------------------------------------------

        protected IQuest GetRootQuest()
        {
            IQuest quest = QuestsManager.Instance.GetQuest(this.uniqueID);

            while (quest != null)
            {
                if (quest.IsQuestRoot())
                {
                    break;
                }
                quest = QuestsManager.Instance.GetQuest(quest.parent.uniqueID);
            }

            return(quest);
        }
Exemple #3
0
        private void LoadQuests()
        {
            DatabaseQuests database = DatabaseQuests.Load();

            this.collection = new Dictionary <string, IQuest>();
            this.quests     = new Dictionary <string, Quest>();

            int questsCount = database.list.Count;

            for (int i = 0; i < questsCount; ++i)
            {
                IQuest reference = database.list[i];
                IQuest instance  = Instantiate(reference);

                this.collection.Add(instance.uniqueID, instance);
                if (instance.IsQuestRoot())
                {
                    this.quests.Add(instance.uniqueID, (Quest)instance);
                }
            }
        }