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