mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 06:32:55 +08:00
Changed finding the spinner gaps via a dictionary instead of getting the thresholds via an array
This commit is contained in:
parent
4e092fed0f
commit
d370f64ac3
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Edit.Checks.Components;
|
using osu.Game.Rulesets.Edit.Checks.Components;
|
||||||
@ -15,8 +16,15 @@ namespace osu.Game.Rulesets.Catch.Edit.Checks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class CheckBananaShowerGap : ICheck
|
public class CheckBananaShowerGap : ICheck
|
||||||
{
|
{
|
||||||
private static readonly int[] spinner_start_delta_threshold = { 250, 250, 125, 125, 62, 62 };
|
private static readonly Dictionary<DifficultyRating, (int startGap, int endGap)> spinner_delta_threshold = new Dictionary<DifficultyRating, (int, int)>
|
||||||
private static readonly int[] spinner_end_delta_threshold = { 250, 250, 250, 125, 125, 125 };
|
{
|
||||||
|
[DifficultyRating.Easy] = (250, 250),
|
||||||
|
[DifficultyRating.Normal] = (250, 250),
|
||||||
|
[DifficultyRating.Hard] = (125, 250),
|
||||||
|
[DifficultyRating.Insane] = (125, 125),
|
||||||
|
[DifficultyRating.Expert] = (62, 125),
|
||||||
|
[DifficultyRating.ExpertPlus] = (62, 125)
|
||||||
|
};
|
||||||
|
|
||||||
public CheckMetadata Metadata { get; } = new CheckMetadata(CheckCategory.Compose, "Too short spinner gap");
|
public CheckMetadata Metadata { get; } = new CheckMetadata(CheckCategory.Compose, "Too short spinner gap");
|
||||||
|
|
||||||
@ -29,9 +37,7 @@ namespace osu.Game.Rulesets.Catch.Edit.Checks
|
|||||||
public IEnumerable<Issue> Run(BeatmapVerifierContext context)
|
public IEnumerable<Issue> Run(BeatmapVerifierContext context)
|
||||||
{
|
{
|
||||||
var hitObjects = context.Beatmap.HitObjects;
|
var hitObjects = context.Beatmap.HitObjects;
|
||||||
int interpretedDifficulty = (int)context.InterpretedDifficulty;
|
(int expectedStartDelta, int expectedEndDelta) = spinner_delta_threshold[context.InterpretedDifficulty];
|
||||||
int expectedStartDelta = spinner_start_delta_threshold[interpretedDifficulty];
|
|
||||||
int expectedEndDelta = spinner_end_delta_threshold[interpretedDifficulty];
|
|
||||||
|
|
||||||
for (int i = 0; i < hitObjects.Count - 1; ++i)
|
for (int i = 0; i < hitObjects.Count - 1; ++i)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user