Fix `BeatmapDifficulty` cloning regression

This commit is contained in:
Dean Herbert 2022-01-11 14:19:35 +09:00
parent b5975eee33
commit 286994a808
2 changed files with 4 additions and 1 deletions

View File

@ -191,6 +191,9 @@ private bool shouldConvertSliderToHits(HitObject obj, IBeatmap beatmap, IHasDist
protected override Beatmap<TaikoHitObject> CreateBeatmap() => new TaikoBeatmap(); protected override Beatmap<TaikoHitObject> CreateBeatmap() => new TaikoBeatmap();
// Important to note that this is subclassing a realm object.
// Realm doesn't allow this, but for now this can work since we aren't (in theory?) persisting this to the database.
// It is only used during beatmap conversion and processing.
internal class TaikoMultiplierAppliedDifficulty : BeatmapDifficulty internal class TaikoMultiplierAppliedDifficulty : BeatmapDifficulty
{ {
public TaikoMultiplierAppliedDifficulty(IBeatmapDifficultyInfo difficulty) public TaikoMultiplierAppliedDifficulty(IBeatmapDifficultyInfo difficulty)

View File

@ -39,7 +39,7 @@ public BeatmapDifficulty(IBeatmapDifficultyInfo source)
/// </summary> /// </summary>
public BeatmapDifficulty Clone() public BeatmapDifficulty Clone()
{ {
var diff = new BeatmapDifficulty(); var diff = (BeatmapDifficulty)MemberwiseClone();
CopyTo(diff); CopyTo(diff);
return diff; return diff;
} }