示例#1
0
        protected sealed override void PrepareProto()
        {
            var tasks         = new TasksList();
            var prerequisites = new QuestsList();

            // ReSharper disable once LocalVariableHidesMember
            var hintsList = new HintsList();

            if (!string.IsNullOrEmpty(this.Hints))
            {
                hintsList.Add(this.Hints);
            }

            this.PrepareQuest(prerequisites, tasks, hintsList);

            Api.Assert(tasks.Count >= 1, "At least one task required for a quest");
            Api.Assert(tasks.Count <= 256, "Max 256 tasks per quest");
            Api.Assert(prerequisites.Count <= 256, "Max 256 prerequisites per quest");

            foreach (var task in tasks)
            {
                task.TaskTarget = this;
            }

            this.Tasks         = tasks;
            this.Prerequisites = prerequisites;

            this.hintsList = hintsList;
        }
示例#2
0
        protected sealed override void PrepareProto()
        {
            var tasks         = new TasksList();
            var prerequisites = new QuestsList();

            var tempHints = HintsList.GetTempList();

            if (!string.IsNullOrEmpty(this.Hints))
            {
                tempHints.Add(this.Hints);
            }

            this.PrepareQuest(prerequisites, tasks, tempHints);

            Api.Assert(tasks.Count >= 1, "At least one task required for a quest");
            Api.Assert(tasks.Count <= 256, "Max 256 tasks per quest");
            Api.Assert(prerequisites.Count <= 256, "Max 256 prerequisites per quest");

            foreach (var task in tasks)
            {
                task.TaskTarget = this;
            }

            this.Tasks         = tasks;
            this.Prerequisites = prerequisites;

            this.cachedHints = tempHints.ToString();
            tempHints.Clear();
        }
示例#3
0
 protected abstract void PrepareQuest(QuestsList prerequisites, TasksList tasks, HintsList hints);