2021-10-11 14:25:00 +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.
|
|
|
|
|
|
2021-10-13 11:51:41 +08:00
|
|
|
|
using osu.Framework.Testing;
|
2021-10-11 14:25:00 +08:00
|
|
|
|
using Realms;
|
|
|
|
|
|
|
|
|
|
#nullable enable
|
|
|
|
|
|
2021-11-19 18:07:21 +08:00
|
|
|
|
namespace osu.Game.Beatmaps
|
2021-10-11 14:25:00 +08:00
|
|
|
|
{
|
2021-10-13 11:51:41 +08:00
|
|
|
|
[ExcludeFromDynamicCompile]
|
2021-10-11 14:25:00 +08:00
|
|
|
|
[MapTo("BeatmapDifficulty")]
|
2021-11-19 18:07:21 +08:00
|
|
|
|
public class BeatmapDifficulty : EmbeddedObject, IBeatmapDifficultyInfo
|
2021-10-11 14:25:00 +08:00
|
|
|
|
{
|
2021-11-19 18:24:07 +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;
|
|
|
|
|
|
2021-10-11 14:25:00 +08:00
|
|
|
|
public float DrainRate { get; set; } = IBeatmapDifficultyInfo.DEFAULT_DIFFICULTY;
|
|
|
|
|
public float CircleSize { get; set; } = IBeatmapDifficultyInfo.DEFAULT_DIFFICULTY;
|
|
|
|
|
public float OverallDifficulty { get; set; } = IBeatmapDifficultyInfo.DEFAULT_DIFFICULTY;
|
|
|
|
|
public float ApproachRate { get; set; } = IBeatmapDifficultyInfo.DEFAULT_DIFFICULTY;
|
|
|
|
|
|
|
|
|
|
public double SliderMultiplier { get; set; } = 1;
|
|
|
|
|
public double SliderTickRate { get; set; } = 1;
|
|
|
|
|
|
2021-11-19 18:24:07 +08:00
|
|
|
|
public BeatmapDifficulty()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BeatmapDifficulty(IBeatmapDifficultyInfo source)
|
|
|
|
|
{
|
|
|
|
|
CopyFrom(source);
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-11 14:25:00 +08:00
|
|
|
|
/// <summary>
|
2021-11-19 18:07:21 +08:00
|
|
|
|
/// Returns a shallow-clone of this <see cref="BeatmapDifficulty"/>.
|
2021-10-11 14:25:00 +08:00
|
|
|
|
/// </summary>
|
2022-01-13 12:23:41 +08:00
|
|
|
|
public virtual BeatmapDifficulty Clone() => new BeatmapDifficulty(this);
|
2021-10-11 14:25:00 +08:00
|
|
|
|
|
2021-11-19 18:24:07 +08:00
|
|
|
|
public virtual void CopyTo(BeatmapDifficulty difficulty)
|
2021-10-11 14:25:00 +08:00
|
|
|
|
{
|
|
|
|
|
difficulty.ApproachRate = ApproachRate;
|
|
|
|
|
difficulty.DrainRate = DrainRate;
|
|
|
|
|
difficulty.CircleSize = CircleSize;
|
|
|
|
|
difficulty.OverallDifficulty = OverallDifficulty;
|
|
|
|
|
|
|
|
|
|
difficulty.SliderMultiplier = SliderMultiplier;
|
|
|
|
|
difficulty.SliderTickRate = SliderTickRate;
|
|
|
|
|
}
|
2021-11-19 18:24:07 +08:00
|
|
|
|
|
|
|
|
|
public virtual void CopyFrom(IBeatmapDifficultyInfo other)
|
|
|
|
|
{
|
|
|
|
|
ApproachRate = other.ApproachRate;
|
|
|
|
|
DrainRate = other.DrainRate;
|
|
|
|
|
CircleSize = other.CircleSize;
|
|
|
|
|
OverallDifficulty = other.OverallDifficulty;
|
|
|
|
|
|
|
|
|
|
SliderMultiplier = other.SliderMultiplier;
|
|
|
|
|
SliderTickRate = other.SliderTickRate;
|
|
|
|
|
}
|
2021-10-11 14:25:00 +08:00
|
|
|
|
}
|
|
|
|
|
}
|