// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Game.Configuration; using osu.Game.Rulesets; using osu.Game.Rulesets.Configuration; namespace osu.Game.Overlays.Settings { /// /// A which provides subclasses with the /// from the 's . /// public abstract class RulesetSettingsSubsection : SettingsSubsection { private readonly Ruleset ruleset; protected IRulesetConfigManager Config; protected RulesetSettingsSubsection(Ruleset ruleset) { this.ruleset = ruleset; } private DependencyContainer dependencies; protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) { dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); Config = dependencies.Get().GetConfigFor(ruleset); if (Config != null) dependencies.Cache(Config); return dependencies; } } }