mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 04:52:57 +08:00
Add diffcalc beatmap decoder
This commit is contained in:
parent
b7499fa956
commit
9facf707be
@ -3,7 +3,6 @@
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using OpenTK;
|
||||
|
||||
|
@ -0,0 +1,36 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// 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
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="LegacyBeatmapDecoder"/> built for difficulty calculation of legacy <see cref="Beatmap"/>s
|
||||
/// <remarks>
|
||||
/// To use this, the decoder must be registered by the application through <see cref="LegacyDifficultyCalculatorBeatmapDecoder.Register"/>.
|
||||
/// Doing so will override any existing <see cref="Beatmap"/> decoders.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public class LegacyDifficultyCalculatorBeatmapDecoder : LegacyBeatmapDecoder
|
||||
{
|
||||
public LegacyDifficultyCalculatorBeatmapDecoder(int version = LATEST_VERSION)
|
||||
: base(version)
|
||||
{
|
||||
}
|
||||
|
||||
public new static void Register()
|
||||
{
|
||||
AddDecoder<Beatmap>(@"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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user