1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-04 04:13:37 +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
Unverified
parent e703d9e814
commit 8dda5aada8
4 changed files with 19 additions and 1 deletions
@@ -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();
@@ -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;
}
}
}
@@ -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);
@@ -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;
}
}
}