local u=import("\046\047\099\114\101\097\116\101\083\101\116\116\105\110\103\115")local p=import("\046\047\102\117\110\099\116\105\111\110\115")local I=import("\046\047\108\105\098\115")local O=import("\046\047\116\097\115\107\070\117\110\099\116\105\111\110\115")local h=import("\046\047\116\121\112\101\115")local M=import("\046\047\069\110\117\109")local D=import("\046\047\073\110\115\116\097\110\099\101")local X={}for u,p in pairs(_G)do X[u]=p end for u,p in pairs(h)do X[u]=p end for u,p in pairs(I)do X[u]=p end X.Instance=D X.Enum=M X.__LEMUR__=true local function x(I)local h={}for u,p in pairs(X)do h[u]=p end for u,p in pairs(p)do h[u]=p end for u,p in pairs(O)do h[u]=p(I.taskScheduler)end h.settings=u(I.settings)h.require=function(u)return I:require(u)end h.game=I.game return h end return x
local createSettings = import("./createSettings")
local functions = import("./functions")
local libs = import("./libs")
local taskFunctions = import("./taskFunctions")
local types = import("./types")
local Enum = import("./Enum")
local Instance = import("./Instance")

local baseEnvironment = {}

for key, value in pairs(_G) do
	baseEnvironment[key] = value
end

for key, value in pairs(types) do
	baseEnvironment[key] = value
end

for key, lib in pairs(libs) do
	baseEnvironment[key] = lib
end

baseEnvironment.Instance = Instance
baseEnvironment.Enum = Enum
baseEnvironment.__LEMUR__ = true

--[[
	Create a new script environment, suitable for use with the given habitat.
]]
local function createEnvironment(habitat)
	local environment = {}

	for key, value in pairs(baseEnvironment) do
		environment[key] = value
	end

	for key, fn in pairs(functions) do
		environment[key] = fn
	end

	for key, fnCreator in pairs(taskFunctions) do
		environment[key] = fnCreator(habitat.taskScheduler)
	end

	environment.settings = createSettings(habitat.settings)

	environment.require = function(path)
		return habitat:require(path)
	end

	environment.game = habitat.game

	return environment
end

return createEnvironment