// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Game.Configuration; using osu.Game.Rulesets; namespace osu.Game.Overlays.Settings { /// /// A which provides subclasses with the /// from the 's . /// public abstract class RulesetSettingsSubsection : SettingsSubsection { private readonly Ruleset ruleset; protected RulesetSettingsSubsection(Ruleset ruleset) { this.ruleset = ruleset; } private DependencyContainer dependencies; protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) { dependencies = new DependencyContainer(base.CreateLocalDependencies(parent)); var config = ruleset.CreateConfig(dependencies.Get()); if (config != null) dependencies.Cache(config); return dependencies; } } }