local q=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local Q=q:WaitForChild("\077\111\100\117\108\101\115")local R=require(Q.src.utils.Logger)local j=((game:GetService("\083\116\097\114\116\101\114\080\108\097\121\101\114")):WaitForChild("\083\116\097\114\116\101\114\080\108\097\121\101\114\083\099\114\105\112\116\115")).clientSrc local E=game:GetService("\087\111\114\107\115\112\097\099\101")local x=require(Q.M)local F=require(Q.src.objects.InventoryObjects)local J=F.RoomObjects local S=require(Q.Roact)local k=require(Q.RoactMaterial)local i=S.createElement local g=require(j.getApiFromComponent)local X=require(j.Components.InventoryAndShopButtons)local L=require(j.Components.FinishScreen)local h=require(j.Components.common.Notifications)local v=require(j.Components.ClockScreen)local b=require(j.Components.Room)local w=require(j.Components.LeaderboardsConnect)local f=S.PureComponent:extend("\071\097\109\101")function f.init(Q,q)Q.api=g(Q)end function f.render(Q,q)local R={}function createRoom(q)R[q.name]=i(S.Portal,{target=E},{["\082\111\111\109"..q.name]=i(b,{roomId=q.id})})end x.each(J,createRoom)R.InventoryContainer=i("\070\114\097\109\101",{Size=UDim2.new(1,0,1,0);BackgroundTransparency=1,BorderSizePixel=5;BorderMode=Enum.BorderMode.Inset,ZIndex=2},{Inventory=i(X)})R.ClockScreenContainer=i("\070\114\097\109\101",{Position=UDim2.new(.5,0,0,-30);AnchorPoint=Vector2.new(.5,0);BackgroundTransparency=1},{Clock=i(v)})R.FinishScreenContainer=i("\070\114\097\109\101",{Size=UDim2.new(.8,0,.9,0);Position=UDim2.new(.5,0,.5,-50),AnchorPoint=Vector2.new(.5,.5);BackgroundTransparency=1},{Finish=i(L)})R.NotificationsContainer=i(h)R.LeaderboardsContainer=i(S.Portal,{target=E},{Leaderboards=i(w)})return S.createElement(k.ThemeProvider,{Theme=k.Themes.Light},{i("\083\099\114\101\101\110\071\117\105",{ZIndexBehavior=Enum.ZIndexBehavior.Sibling,ResetOnSpawn=false},R)})end return f
--[[
	This Roact component represents our entire game.
]]
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Modules = ReplicatedStorage:WaitForChild('Modules')
local logger = require(Modules.src.utils.Logger)
local clientSrc = game:GetService('StarterPlayer'):WaitForChild('StarterPlayerScripts').clientSrc

local Workspace = game:GetService('Workspace')
local M = require(Modules.M)
local InventoryObjects = require(Modules.src.objects.InventoryObjects)
local RoomObjects = InventoryObjects.RoomObjects
local Roact = require(Modules.Roact)
local RoactMaterial = require(Modules.RoactMaterial)

local createElement = Roact.createElement

local getApiFromComponent = require(clientSrc.getApiFromComponent)

local InventoryAndShopButtons = require(clientSrc.Components.InventoryAndShopButtons)
local FinishScreen = require(clientSrc.Components.FinishScreen)
local Notifications = require(clientSrc.Components.common.Notifications)
local ClockScreen = require(clientSrc.Components.ClockScreen)
local Room = require(clientSrc.Components.Room)
local LeaderboardsConnect = require(clientSrc.Components.LeaderboardsConnect)

local Game = Roact.PureComponent:extend('Game')

function Game:init(props)
	self.api = getApiFromComponent(self)
end

function Game:render(props)
	local children = {}
	function createRoom(roomObject)
		children[roomObject.name] =
			createElement(
				Roact.Portal,
				{ target = Workspace },
				{ ['Room' .. roomObject.name] = createElement(Room, { roomId = roomObject.id }) }
			)
	end

	M.each(RoomObjects, createRoom)

	children['InventoryContainer'] = createElement(
		'Frame',
		{
			Size = UDim2.new(1, 0, 1, 0),
			BackgroundTransparency = 1,
			BorderSizePixel = 5,
			BorderMode = Enum.BorderMode.Inset,
			ZIndex = 2,
		},
		{ Inventory = createElement(InventoryAndShopButtons) }
	)
	children['ClockScreenContainer'] = createElement(
		'Frame',
		{
			Position = UDim2.new(0.5, 0, 0, -30),
			AnchorPoint = Vector2.new(0.5, 0),
			BackgroundTransparency = 1,
		},
		{ Clock = createElement(ClockScreen) }
	)
	children['FinishScreenContainer'] = createElement(
		'Frame',
		{
			Size = UDim2.new(0.8, 0, 0.9, 0),
			Position = UDim2.new(0.5, 0, 0.5, -50),
			AnchorPoint = Vector2.new(0.5, 0.5),
			BackgroundTransparency = 1,
		},
		{ Finish = createElement(FinishScreen) }
	)
	children['NotificationsContainer'] = createElement(Notifications)
	children['LeaderboardsContainer'] =
		createElement(
			Roact.Portal,
			{ target = Workspace },
			{ Leaderboards = createElement(LeaderboardsConnect) }
		)

	return Roact.createElement(
		RoactMaterial.ThemeProvider,
		{ Theme = RoactMaterial.Themes.Light },
		{ createElement(
			'ScreenGui',
			{
				ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
				ResetOnSpawn = false,
			},
			children
		) }
	)
end

return Game