Add a way to have ruleset-specific configs

This commit is contained in:
smoogipoo
2018-01-17 19:45:18 +09:00
parent 18cdd1caac
commit 0b7e1ce667
5 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,24 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Configuration;
using osu.Framework.Platform;
namespace osu.Game.Rulesets.Configuration
{
public abstract class RulesetConfigManager<T> : ConfigManager<T>, IRulesetConfigManager
where T : struct
{
protected override string Filename => ruleset?.ShortName;
private readonly Ruleset ruleset;
protected RulesetConfigManager(Ruleset ruleset, Storage storage)
: base(storage)
{
this.ruleset = ruleset;
// Re-load with the ruleset
Load();
}
}
}