// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; using osu.Game.Beatmaps.ControlPoints; namespace osu.Game.Beatmaps.Formats { /// /// A built for difficulty calculation of legacy s /// /// To use this, the decoder must be registered by the application through . /// Doing so will override any existing decoders. /// /// public class LegacyDifficultyCalculatorBeatmapDecoder : LegacyBeatmapDecoder { public LegacyDifficultyCalculatorBeatmapDecoder(int version = LATEST_VERSION) : base(version) { ApplyOffsets = false; } public new static void Register() { AddDecoder(@"osu file format v", m => new LegacyDifficultyCalculatorBeatmapDecoder(int.Parse(m.Split('v').Last()))); } protected override TimingControlPoint CreateTimingControlPoint() => new LegacyDifficultyCalculatorControlPoint(); private class LegacyDifficultyCalculatorControlPoint : TimingControlPoint { public override double BeatLength { get; set; } = 1000; } } }