local y=game:GetService("\083\101\114\118\101\114\083\116\111\114\097\103\101")local C=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local e=require(y.Source.BaseMinigame)local E=require(C.Source.Common.Flags)local c={require(y.Source.Minigames.Platform);require(y.Source.Minigames.Bombs);require(y.Source.Minigames.Volcano)}local s=E.FirstRound and E.FirstRound-1 or math.random(1,#c)local O={}local o function O.selectNextMinigame()s=s+1 if s>#c then s=1 end end function O.getNextMinigame()return c[s]end function O.initialiseMinigame()local y=c[s]o=e.new(y)end
--[[
	Singleton, holds the current minigame, and constructs new minigames
]]
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
