local k=import("\046\047\099\114\101\097\116\101\083\101\116\116\105\110\103\115")local s=import("\046\047\102\117\110\099\116\105\111\110\115")local b=import("\046\047\108\105\098\115")local L=import("\046\047\116\097\115\107\070\117\110\099\116\105\111\110\115")local J=import("\046\047\116\121\112\101\115")local w=import("\046\047\069\110\117\109")local n=import("\046\047\073\110\115\116\097\110\099\101")local Z={}for k,s in pairs(_G)do Z[k]=s end for k,s in pairs(J)do Z[k]=s end for k,s in pairs(b)do Z[k]=s end Z.Instance=n Z.Enum=w Z.__LEMUR__=true local function j(b)local J={}for k,s in pairs(Z)do J[k]=s end for k,s in pairs(s)do J[k]=s end for k,s in pairs(L)do J[k]=s(b.taskScheduler)end J.settings=k(b.settings)J.require=function(k)return b:require(k)end J.game=b.game return J end return j
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