From 65a2e09593d9210b8aadd480372c3a646da6028e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 15:03:05 +0900 Subject: [PATCH] Privatise VariantMappingGenerator to ManiaRuleset --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 90 ++++++++++++------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index f0feae67f9..a0c79467d0 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -242,58 +242,58 @@ namespace osu.Game.Rulesets.Mania { return (PlayfieldType)Enum.GetValues(typeof(PlayfieldType)).Cast().OrderByDescending(i => i).First(v => variant >= v); } - } - public class VariantMappingGenerator - { - /// - /// All the s available to the left hand. - /// - public InputKey[] LeftKeys; - - /// - /// All the s available to the right hand. - /// - public InputKey[] RightKeys; - - /// - /// The for the special key. - /// - public InputKey SpecialKey; - - /// - /// The at which the normal columns should begin. - /// - public ManiaAction NormalActionStart; - - /// - /// The for the special column. - /// - public ManiaAction SpecialAction; - - /// - /// Generates a list of s for a specific number of columns. - /// - /// The number of columns that need to be bound. - /// The next to use for normal columns. - /// The keybindings. - public IEnumerable GenerateKeyBindingsFor(int columns, out ManiaAction nextNormalAction) + private class VariantMappingGenerator { - ManiaAction currentNormalAction = NormalActionStart; + /// + /// All the s available to the left hand. + /// + public InputKey[] LeftKeys; - var bindings = new List(); + /// + /// All the s available to the right hand. + /// + public InputKey[] RightKeys; - for (int i = LeftKeys.Length - columns / 2; i < LeftKeys.Length; i++) - bindings.Add(new KeyBinding(LeftKeys[i], currentNormalAction++)); + /// + /// The for the special key. + /// + public InputKey SpecialKey; - for (int i = 0; i < columns / 2; i++) - bindings.Add(new KeyBinding(RightKeys[i], currentNormalAction++)); + /// + /// The at which the normal columns should begin. + /// + public ManiaAction NormalActionStart; - if (columns % 2 == 1) - bindings.Add(new KeyBinding(SpecialKey, SpecialAction)); + /// + /// The for the special column. + /// + public ManiaAction SpecialAction; - nextNormalAction = currentNormalAction; - return bindings; + /// + /// Generates a list of s for a specific number of columns. + /// + /// The number of columns that need to be bound. + /// The next to use for normal columns. + /// The keybindings. + public IEnumerable GenerateKeyBindingsFor(int columns, out ManiaAction nextNormalAction) + { + ManiaAction currentNormalAction = NormalActionStart; + + var bindings = new List(); + + for (int i = LeftKeys.Length - columns / 2; i < LeftKeys.Length; i++) + bindings.Add(new KeyBinding(LeftKeys[i], currentNormalAction++)); + + for (int i = 0; i < columns / 2; i++) + bindings.Add(new KeyBinding(RightKeys[i], currentNormalAction++)); + + if (columns % 2 == 1) + bindings.Add(new KeyBinding(SpecialKey, SpecialAction)); + + nextNormalAction = currentNormalAction; + return bindings; + } } }