Ejemplo n.º 1
0
 public void AddQuest(QuestBase quest)
 {
     if (Quests == null)
     {
         Quests = new List <QuestBase>();
     }
     Quests.Add(quest);
 }
        private void QuestsLoad(JSONNode node)
        {
            QuestsDict = new Dictionary <int, QuestBase>();
            foreach (JSONNode doc in node.AsArray)
            {
                QuestType type  = doc["type"].Value.ToEnumVal <QuestType>();
                QuestBase quest = null;
                switch (type)
                {
                case QuestType.testQuest:
                    quest = new TestQuest(doc);
                    break;
                }

                if (quest == null)
                {
                    continue;
                }
                QuestsDict[quest.Id] = quest;
                NPCsDict[quest.NPCId].AddQuest(quest);
            }
        }