From 2674859b54ac7f50bf6185f3d0594f42b71a3d03 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 14:59:17 +0900 Subject: [PATCH] ManiaKeyBindingVariantType -> PlayfieldType --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 24 +++++++++---------- .../Mods/IKeyBindingMod.cs | 2 +- .../Mods/ManiaModKeyCoop.cs | 2 +- .../UI/ManiaRulesetContainer.cs | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 01e7d39897..f0feae67f9 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -124,9 +124,9 @@ namespace osu.Game.Rulesets.Mania get { for (int i = 1; i <= 9; i++) - yield return (int)ManiaKeyBindingVariantType.Single + i; + yield return (int)PlayfieldType.Single + i; for (int i = 2; i <= 18; i++) - yield return (int)ManiaKeyBindingVariantType.Dual + i; + yield return (int)PlayfieldType.Dual + i; } } @@ -134,7 +134,7 @@ namespace osu.Game.Rulesets.Mania { switch (getVariantType(variant)) { - case ManiaKeyBindingVariantType.Single: + case PlayfieldType.Single: return new VariantMappingGenerator { LeftKeys = new[] @@ -155,7 +155,7 @@ namespace osu.Game.Rulesets.Mania SpecialAction = ManiaAction.Special1, NormalActionStart = ManiaAction.Key1, }.GenerateKeyBindingsFor(variant, out _); - case ManiaKeyBindingVariantType.Dual: + case PlayfieldType.Dual: getDualStageKeyCounts(variant, out int s1K, out int s2K); var stage1Bindings = new VariantMappingGenerator @@ -212,7 +212,7 @@ namespace osu.Game.Rulesets.Mania { default: return $"{variant}K"; - case ManiaKeyBindingVariantType.Dual: + case PlayfieldType.Dual: { getDualStageKeyCounts(variant, out int s1K, out int s2K); return $"{s1K}K + {s2K}K"; @@ -221,26 +221,26 @@ namespace osu.Game.Rulesets.Mania } /// - /// Finds the number of keys for each stage in a variant. + /// Finds the number of keys for each stage in a variant. /// /// The variant. /// The number of keys for the first stage. /// The number of keys for the second stage. private void getDualStageKeyCounts(int variant, out int stage1, out int stage2) { - int totalKeys = variant - (int)ManiaKeyBindingVariantType.Dual; + int totalKeys = variant - (int)PlayfieldType.Dual; stage1 = (int)Math.Ceiling(totalKeys / 2f); stage2 = (int)Math.Floor(totalKeys / 2f); } /// - /// Finds the that corresponds to a variant value. + /// Finds the that corresponds to a variant value. /// /// The variant value. - /// The that corresponds to . - private ManiaKeyBindingVariantType getVariantType(int variant) + /// The that corresponds to . + private PlayfieldType getVariantType(int variant) { - return (ManiaKeyBindingVariantType)Enum.GetValues(typeof(ManiaKeyBindingVariantType)).Cast().OrderByDescending(i => i).First(v => variant >= v); + return (PlayfieldType)Enum.GetValues(typeof(PlayfieldType)).Cast().OrderByDescending(i => i).First(v => variant >= v); } } @@ -297,7 +297,7 @@ namespace osu.Game.Rulesets.Mania } } - public enum ManiaKeyBindingVariantType + public enum PlayfieldType { /// /// A single stage. diff --git a/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs b/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs index 585db9e340..0eeacc7ce4 100644 --- a/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs @@ -8,6 +8,6 @@ namespace osu.Game.Rulesets.Mania.Mods /// /// The keybinding variant which this requires. /// - ManiaKeyBindingVariantType Variant { get; } + PlayfieldType Variant { get; } } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs index 7ce220ce4f..2fd81b6e40 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs @@ -45,6 +45,6 @@ namespace osu.Game.Rulesets.Mania.Mods mrc.Beatmap.Stages = newDefinitions; } - public ManiaKeyBindingVariantType Variant => ManiaKeyBindingVariantType.Dual; + public PlayfieldType Variant => PlayfieldType.Dual; } } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 45e840d5e1..6e24a266a5 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -79,7 +79,7 @@ namespace osu.Game.Rulesets.Mania.UI public override PassThroughInputManager CreateInputManager() { - var variantType = Mods.OfType().FirstOrDefault()?.Variant ?? ManiaKeyBindingVariantType.Single; + var variantType = Mods.OfType().FirstOrDefault()?.Variant ?? PlayfieldType.Single; return new ManiaInputManager(Ruleset.RulesetInfo, (int)variantType + Beatmap.TotalColumns); }