local l=game:GetService("\083\101\114\118\101\114\083\116\111\114\097\103\101")local i=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local x=require(l.Source.BaseMinigame)local L=require(i.Source.Common.Flags)local D={require(l.Source.Minigames.Platform);require(l.Source.Minigames.Bombs);require(l.Source.Minigames.Volcano)}local V=L.FirstRound and L.FirstRound-1 or math.random(1,#D)local Y={}local I function Y.selectNextMinigame()V=V+1 if V>#D then V=1 end end function Y.getNextMinigame()return D[V]end function Y.initialiseMinigame()local l=D[V]I=x.new(l)end

local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local BaseMinigame = require(ServerStorage.Source.BaseMinigame)
local Flags = require(ReplicatedStorage.Source.Common.Flags)

local minigameModules = {
	require(ServerStorage.Source.Minigames.Platform),
	require(ServerStorage.Source.Minigames.Bombs),
	require(ServerStorage.Source.Minigames.Volcano)
}

local nextRoundIndex = Flags.FirstRound and (Flags.FirstRound - 1) or math.random(1, #minigameModules)

local RoundController = {}

local currentMinigame

function RoundController.selectNextMinigame()
	nextRoundIndex = nextRoundIndex + 1

	if nextRoundIndex > #minigameModules then
		nextRoundIndex = 1
	end
end

function RoundController.getNextMinigame()
	return minigameModules[nextRoundIndex]
end

function RoundController.initialiseMinigame()
	local minigameClass = minigameModules[nextRoundIndex]

	currentMinigame = BaseMinigame.new(minigameClass)
end
