-- Methods


function Sound.Get(Name : string) : Sound
	local s = Map[Name:lower()]
	if not s then warn(("No sound named '%s' found."):format(Name)) return EmptySound:Clone() end
	return s:Clone()
end

function Sound.GetGroup(Name : string) : {Sound}
	return Groups[Name:lower()]
end

function Sound.GetRandomFromGroup(Name : string, Rng : Random) : Sound
	Rng = Rng or System.Random
	local Group = Sound.GetGroup(Name)
	
	if not Group then warn(("No group named '%s' found."):format(Name)) return EmptySound:Clone() end
	return Group[Rng:NextInteger(1, #Group)]:Clone()
end
