2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-11-28 12:19:23 +08:00
|
|
|
|
using osu.Game.Database;
|
2021-10-01 13:38:30 +08:00
|
|
|
|
using osu.Game.Models.Interfaces;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Beatmaps
|
|
|
|
|
{
|
2021-10-01 13:38:30 +08:00
|
|
|
|
public class BeatmapDifficulty : IHasPrimaryKey, IBeatmapDifficultyInfo
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The default value used for all difficulty settings except <see cref="SliderMultiplier"/> and <see cref="SliderTickRate"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public const float DEFAULT_DIFFICULTY = 5;
|
|
|
|
|
|
|
|
|
|
public int ID { get; set; }
|
|
|
|
|
|
|
|
|
|
public float DrainRate { get; set; } = DEFAULT_DIFFICULTY;
|
|
|
|
|
public float CircleSize { get; set; } = DEFAULT_DIFFICULTY;
|
|
|
|
|
public float OverallDifficulty { get; set; } = DEFAULT_DIFFICULTY;
|
|
|
|
|
|
|
|
|
|
private float? approachRate;
|
|
|
|
|
|
|
|
|
|
public float ApproachRate
|
|
|
|
|
{
|
|
|
|
|
get => approachRate ?? OverallDifficulty;
|
|
|
|
|
set => approachRate = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public double SliderMultiplier { get; set; } = 1;
|
|
|
|
|
public double SliderTickRate { get; set; } = 1;
|
|
|
|
|
|
2018-05-17 11:59:48 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns a shallow-clone of this <see cref="BeatmapDifficulty"/>.
|
|
|
|
|
/// </summary>
|
2021-08-30 14:30:17 +08:00
|
|
|
|
public BeatmapDifficulty Clone()
|
|
|
|
|
{
|
|
|
|
|
var diff = new BeatmapDifficulty();
|
|
|
|
|
CopyTo(diff);
|
|
|
|
|
return diff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void CopyTo(BeatmapDifficulty difficulty)
|
|
|
|
|
{
|
|
|
|
|
difficulty.ApproachRate = ApproachRate;
|
|
|
|
|
difficulty.DrainRate = DrainRate;
|
|
|
|
|
difficulty.CircleSize = CircleSize;
|
|
|
|
|
difficulty.OverallDifficulty = OverallDifficulty;
|
|
|
|
|
|
|
|
|
|
difficulty.SliderMultiplier = SliderMultiplier;
|
|
|
|
|
difficulty.SliderTickRate = SliderTickRate;
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|