Пример #1
0
    /// <summary>
    /// Removes a quest from game manager's <see cref="Quests"/> list
    /// </summary>
    /// <param name="completedQuestName">name of the quest to remove</param>
    private void CompleteQuest(string completedQuestName)
    {
        Quest completedQuest = Quests.FirstOrDefault(quest => quest.Name == completedQuestName);

        if (completedQuest == null)
        {
            throw new ArgumentNullException(
                      String.Join(" ", new string[] { "Quest", completedQuestName, "not found." }));
        }
        else
        {
            Quests.Remove(completedQuest);
        }
    }
Пример #2
0
 public Quest GetQuest(string name)
 {
     return(Quests.FirstOrDefault(i => i.Name == name));
 }