mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add required properties to make realm models backwards compatible
This commit is contained in:
@ -12,6 +12,11 @@ namespace osu.Game.Beatmaps
|
||||
[MapTo("BeatmapDifficulty")]
|
||||
public class BeatmapDifficulty : EmbeddedObject, IBeatmapDifficultyInfo
|
||||
{
|
||||
/// <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 float DrainRate { get; set; } = IBeatmapDifficultyInfo.DEFAULT_DIFFICULTY;
|
||||
public float CircleSize { get; set; } = IBeatmapDifficultyInfo.DEFAULT_DIFFICULTY;
|
||||
public float OverallDifficulty { get; set; } = IBeatmapDifficultyInfo.DEFAULT_DIFFICULTY;
|
||||
@ -20,6 +25,15 @@ namespace osu.Game.Beatmaps
|
||||
public double SliderMultiplier { get; set; } = 1;
|
||||
public double SliderTickRate { get; set; } = 1;
|
||||
|
||||
public BeatmapDifficulty()
|
||||
{
|
||||
}
|
||||
|
||||
public BeatmapDifficulty(IBeatmapDifficultyInfo source)
|
||||
{
|
||||
CopyFrom(source);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a shallow-clone of this <see cref="BeatmapDifficulty"/>.
|
||||
/// </summary>
|
||||
@ -30,7 +44,7 @@ namespace osu.Game.Beatmaps
|
||||
return diff;
|
||||
}
|
||||
|
||||
public void CopyTo(BeatmapDifficulty difficulty)
|
||||
public virtual void CopyTo(BeatmapDifficulty difficulty)
|
||||
{
|
||||
difficulty.ApproachRate = ApproachRate;
|
||||
difficulty.DrainRate = DrainRate;
|
||||
@ -40,5 +54,16 @@ namespace osu.Game.Beatmaps
|
||||
difficulty.SliderMultiplier = SliderMultiplier;
|
||||
difficulty.SliderTickRate = SliderTickRate;
|
||||
}
|
||||
|
||||
public virtual void CopyFrom(IBeatmapDifficultyInfo other)
|
||||
{
|
||||
ApproachRate = other.ApproachRate;
|
||||
DrainRate = other.DrainRate;
|
||||
CircleSize = other.CircleSize;
|
||||
OverallDifficulty = other.OverallDifficulty;
|
||||
|
||||
SliderMultiplier = other.SliderMultiplier;
|
||||
SliderTickRate = other.SliderTickRate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user