local F=(game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\087\111\114\108\100\069\110\103\105\110\101")local t=require(F:WaitForChild("\079\098\106\101\099\116"))local l=require(script.Parent.QuestObjective)local B=require(F:WaitForChild("\116"))local A=require(script.Parent.validator)local U={}local v=B.tuple(B.intersection(A.id,A.uniqueKey(U)),B.string)local W=l.instance local j=t:Extend("\081\117\101\115\116")function j.constructor(l,F,t)assert(v(F,t))l.Id=F l.Name=t l.Objectives={}U[F]=l end function j.AddObjective(t,F)assert(W(F))table.insert(t.Objectives,F)end function j.GetObjectives(F)return F.Objectives end return j
local Libraries = game:GetService("ReplicatedStorage"):WaitForChild("WorldEngine")
local Object = require(Libraries:WaitForChild("Object"))
local QuestObjective = require(script.Parent.QuestObjective)
local t = require(Libraries:WaitForChild("t"))
local qt = require(script.Parent.validator)
local registry = {}

local questConstructorValidator = t.tuple(t.intersection(qt.id, qt.uniqueKey(registry)), t.string)
local isQuestObjective = QuestObjective.instance

local Quest = Object:Extend("Quest")
function Quest:constructor(uniqueQuestId, name)
	assert(questConstructorValidator(uniqueQuestId, name))
	self.Id = uniqueQuestId
	self.Name = name
	self.Objectives = {}

	registry[uniqueQuestId] = self
end

function Quest:AddObjective(objective)
	assert(isQuestObjective(objective))
	table.insert(self.Objectives, objective)
end

function Quest:GetObjectives()
	return self.Objectives
end

return Quest
