/// <summary> /// Gets the <see cref="IQuestDescription"/> for a quest. /// </summary> /// <param name="questID">The ID of the quest to get the <see cref="IQuestDescription"/> for.</param> /// <returns>The <see cref="IQuestDescription"/> for the given <see cref="QuestID"/>.</returns> public IQuestDescription this[QuestID questID] { get { if (!_questDescriptions.CanGet(questID.GetRawValue())) { return(null); } return(_questDescriptions[questID.GetRawValue()]); } }
/// <summary> /// Forces a quest in this collection to be reloaded from the database. /// Note that reloading an object will create a new object, not update the existing object. As a result, anything referencing /// the old object will continue to reference the old values instead of the newly loaded values. /// </summary> /// <param name="questID">The ID of the quest to force to reload.</param> public virtual void Reload(QuestID questID) { // Check for a valid ID range if (questID < 0) { return; } // Resize the array if needed if (questID.GetRawValue() >= _quests.Length) { Array.Resize(ref _quests, questID.GetRawValue() + 1); } // Try to load the quest var q = LoadQuest(questID); _quests[questID.GetRawValue()] = q; }
/// <summary> /// Forces a quest in this collection to be reloaded from the database. /// Note that reloading an object will create a new object, not update the existing object. As a result, anything referencing /// the old object will continue to reference the old values instead of the newly loaded values. /// </summary> /// <param name="questID">The ID of the quest to force to reload.</param> public virtual void Reload(QuestID questID) { // Check for a valid ID range if (questID < 0 || questID > _quests.Length) { return; } // Try to load the quest var q = LoadQuest(questID); _quests[questID.GetRawValue()] = q; }
/// <summary> /// Gets the <see cref="IQuest{TCharacter}"/> for a given <see cref="QuestID"/>. /// </summary> /// <param name="questID">The ID of the quest.</param> /// <returns>The <see cref="IQuest{TCharacter}"/> for the given <paramref name="questID"/>.</returns> public IQuest <TCharacter> GetQuest(QuestID questID) { return(_quests[questID.GetRawValue()]); }