Exemplo n.º 1
0
        public List <Quest> LoadQuestLog()
        {
            var res = new List <Quest>();
            var qd  = _saveFileWrapper.GetActiveQuests();
            var od  = _saveFileWrapper.GetActiveObjectives();

            foreach (var i in qd)
            {
                var quest = new Quest(QuestRepository.GetById(i.Key));
                if (quest.IsTimed)
                {
                    quest.ReduceTime(quest.TimeAllowed - i.Value);
                }
                foreach (var task in quest.Tasks)
                {
                    if (od.ContainsKey(task.Id))
                    {
                        task.AddAmount(od[task.Id]);
                    }
                }
                res.Add(quest);
            }

            return(res);
        }
Exemplo n.º 2
0
        public List <Quest> LoadCompletedQuestLog()
        {
            var res = new List <Quest>();
            var od  = _saveFileWrapper.GetActiveObjectives();
            var cqd = _saveFileWrapper.GetCompletedQuests();

            foreach (var i in cqd)
            {
                var quest = new Quest(QuestRepository.GetById(i.Key));
                foreach (var task in quest.Tasks)
                {
                    task.AddAmount(task.NeededAmount);
                }
                res.Add(quest);
            }

            return(res);
        }
Exemplo n.º 3
0
 public Quest GetQuestById(int id)
 {
     return(new Quest(QuestRepository.GetById(id)));
 }