Example #1
0
        /// <summary>
        /// Mark the quest as finished
        /// </summary>
        /// <param name="questId">the quest to mark as completed</param>
        public void MarkFinished(string questId)
        {
            // Do nothing if already marked as finished
            if (Completed.ContainsKey(questId) && Completed[questId])
            {
                return;
            }

            foreach (var quest in Quests)
            {
                if (quest.Id == questId)
                {
                    if (string.IsNullOrEmpty(quest.Title))
                    {
                        break;
                    }

                    Toolbox.Instance.Notifications.Show(quest.NotificationText);
                }
            }

            Completed[questId] = true;

            // Clear the memoized value if it's no longer the current quest
            if (current != null && current.Id == questId)
            {
                current = null;
            }

            DebounceSave.Run();
        }
Example #2
0
 /// <summary>
 /// Ask whether a quest has been finished
 /// </summary>
 /// <param name="questId">the quest to check</param>
 /// <returns>whether it has been finished</returns>
 public bool HasFinished(string questId)
 {
     return(Completed.ContainsKey(questId) && Completed[questId]);
 }