--[[
	Stage implementation
]]


local EndGame = {}
EndGame.__index = EndGame

function EndGame.new(gameStageHandler)
	local self = setmetatable({
		gameStageHandler = gameStageHandler,
	}, EndGame)

	return self
end

function EndGame:initialize()
	wait(5) -- TODO: Have a buffer time at the end of the game based on a configuration

	-- Teleport players back to the main lobby place
	for _, player in pairs(Players:GetPlayers()) do
		TeleportService:Teleport(Conf.lobby_place, player)
	end
end

function EndGame:playerAdded(player)
	local warningMessage = "Player " .. player.Name .. " joined after game start"
	warn(warningMessage)
	WarningEvent:FireAllClients(warningMessage)
end

function EndGame:destroy()
end

return EndGame
