Add constant for max stage keys

This commit is contained in:
Dean Herbert 2020-04-21 10:56:04 +09:00
parent 597bbadb1b
commit 4c689c6ad2
2 changed files with 8 additions and 3 deletions

View File

@ -47,7 +47,7 @@ public ManiaBeatmapConverter(IBeatmap beatmap, Ruleset ruleset)
{
TargetColumns = (int)Math.Max(1, roundedCircleSize);
if (TargetColumns > 10)
if (TargetColumns > ManiaRuleset.MAX_STAGE_KEYS)
{
TargetColumns /= 2;
Dual = true;

View File

@ -35,6 +35,11 @@ namespace osu.Game.Rulesets.Mania
{
public class ManiaRuleset : Ruleset, ILegacyRuleset
{
/// <summary>
/// The maximum number of supported keys in a single stage.
/// </summary>
public const int MAX_STAGE_KEYS = 10;
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) => new DrawableManiaRuleset(this, beatmap, mods);
public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor();
@ -251,9 +256,9 @@ public override IEnumerable<int> AvailableVariants
{
get
{
for (int i = 1; i <= 10; i++)
for (int i = 1; i <= MAX_STAGE_KEYS; i++)
yield return (int)PlayfieldType.Single + i;
for (int i = 2; i <= 20; i += 2)
for (int i = 2; i <= MAX_STAGE_KEYS * 2; i += 2)
yield return (int)PlayfieldType.Dual + i;
}
}