1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 18:12:55 +08:00

Populate default LegacyType value on convert hitobjects

Normally not an issue, but some tests create their own hitobjects
deriving from `ConvertHitObject`.
This commit is contained in:
Dan Balasescu 2024-12-06 17:29:17 +09:00
parent e703d9e814
commit 8dda5aada8
No known key found for this signature in database
4 changed files with 19 additions and 1 deletions

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
public Vector2 Position { get; set; }
public LegacyHitObjectType LegacyType { get; set; }
public LegacyHitObjectType LegacyType { get; set; } = LegacyHitObjectType.Circle;
public override Judgement CreateJudgement() => new IgnoreJudgement();

View File

@ -1,6 +1,7 @@
// 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.
using osu.Game.Beatmaps.Legacy;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Rulesets.Objects.Legacy
@ -16,5 +17,10 @@ namespace osu.Game.Rulesets.Objects.Legacy
public double Duration { get; set; }
public double EndTime => StartTime + Duration;
public ConvertHold()
{
LegacyType = LegacyHitObjectType.Hold;
}
}
}

View File

@ -8,6 +8,7 @@ using osu.Framework.Bindables;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Beatmaps.Legacy;
namespace osu.Game.Rulesets.Objects.Legacy
{
@ -56,6 +57,11 @@ namespace osu.Game.Rulesets.Objects.Legacy
public bool GenerateTicks { get; set; } = true;
public ConvertSlider()
{
LegacyType = LegacyHitObjectType.Slider;
}
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty)
{
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);

View File

@ -1,6 +1,7 @@
// 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.
using osu.Game.Beatmaps.Legacy;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Rulesets.Objects.Legacy
@ -16,5 +17,10 @@ namespace osu.Game.Rulesets.Objects.Legacy
public double Duration { get; set; }
public double EndTime => StartTime + Duration;
public ConvertSpinner()
{
LegacyType = LegacyHitObjectType.Spinner;
}
}
}