/// <summary> /// Creates a new quest with a given questId, name, and journalTag. /// All arguments are required. Exceptions will be thrown if any are null or whitespace. /// </summary> /// <param name="questId">The quest Id to assign this quest.</param> /// <param name="name">The name of the quest.</param> /// <param name="journalTag">The tag used by the journal entry.</param> /// <returns>A QuestBuilder with the configured options.</returns> public QuestBuilder Create(string questId, string name, string journalTag) { if (string.IsNullOrWhiteSpace(questId)) { throw new ArgumentException($"{nameof(questId)} cannot be null or whitespace."); } if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException($"{nameof(name)} cannot be null or whitespace."); } if (string.IsNullOrWhiteSpace(journalTag)) { throw new ArgumentException($"{nameof(journalTag)} cannot be null or whitespace."); } _activeQuest = new QuestDetail { QuestId = questId, Name = name, JournalTag = journalTag }; _quests[questId] = _activeQuest; _activeState = null; return(this); }
/// <summary> /// Adds a quest state to this quest. /// </summary> /// <returns>The newly created quest state.</returns> protected QuestStateDetail AddState() { int index = States.Count; States[index] = new QuestStateDetail(); return(States[index]); }
/// <summary> /// Adds a new quest state to the quest. /// </summary> /// <returns>A QuestBuilder with the configured options.</returns> public QuestBuilder AddState() { _activeState = new QuestStateDetail(); var index = _activeQuest.States.Count + 1; _activeQuest.States[index] = _activeState; return(this); }