Give HitRenderer a reference to Ruleset

Used to get correct bindings for a mode (ActionMappingInputManager).
This commit is contained in:
Dean Herbert
2017-08-09 13:04:11 +09:00
parent eee6404986
commit 7c0e7ebcd0
19 changed files with 93 additions and 39 deletions

View File

@ -17,12 +17,20 @@ namespace osu.Game.Input
public class ActionMappingInputManager<T> : PassThroughInputManager
where T : struct
{
private readonly RulesetInfo ruleset;
protected ActionMappingInputManager(RulesetInfo ruleset = null)
{
this.ruleset = ruleset;
}
protected IDictionary<Key, T> Mappings { get; set; }
[BackgroundDependencyLoader]
private void load(BindingStore bindings)
{
foreach (var b in bindings.Query<Binding>())
var rulesetId = ruleset?.ID;
foreach (var b in bindings.Query<Binding>(b => b.RulesetID == rulesetId))
Mappings[b.Key] = (T)(object)b.Action;
}