mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Fix unit tests.
This commit is contained in:
@ -7,7 +7,7 @@ using OpenTK;
|
||||
namespace osu.Game.Modes.Objects.Legacy
|
||||
{
|
||||
/// <summary>
|
||||
/// Base Hit-type, used for parsing Beatmaps.
|
||||
/// Legacy Hit-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
public sealed class LegacyHit : HitObject, IHasPosition, IHasCombo
|
||||
{
|
||||
|
18
osu.Game/Modes/Objects/Legacy/LegacyHold.cs
Normal file
18
osu.Game/Modes/Objects/Legacy/LegacyHold.cs
Normal file
@ -0,0 +1,18 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK;
|
||||
using osu.Game.Modes.Objects.Types;
|
||||
|
||||
namespace osu.Game.Modes.Objects.Legacy
|
||||
{
|
||||
/// <summary>
|
||||
/// Legacy Hold-type, used for parsing "specials" in beatmaps.
|
||||
/// </summary>
|
||||
public sealed class LegacyHold : HitObject, IHasPosition, IHasCombo
|
||||
{
|
||||
public Vector2 Position { get; set; }
|
||||
|
||||
public bool NewCombo { get; set; }
|
||||
}
|
||||
}
|
@ -8,7 +8,7 @@ using OpenTK;
|
||||
namespace osu.Game.Modes.Objects.Legacy
|
||||
{
|
||||
/// <summary>
|
||||
/// Base Slider-type, used for parsing Beatmaps.
|
||||
/// Legacy Slider-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
public sealed class LegacySlider : HitObject, IHasCurve, IHasPosition, IHasDistance, IHasRepeats, IHasCombo
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ using osu.Game.Modes.Objects.Types;
|
||||
namespace osu.Game.Modes.Objects.Legacy
|
||||
{
|
||||
/// <summary>
|
||||
/// Base Spinner-type, used for parsing Beatmaps.
|
||||
/// Legacy Spinner-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal class LegacySpinner : HitObject, IHasEndTime
|
||||
{
|
||||
|
@ -18,7 +18,6 @@ namespace osu.Game.Modes.Objects
|
||||
string[] split = text.Split(',');
|
||||
var type = (HitObjectType)int.Parse(split[3]);
|
||||
bool combo = type.HasFlag(HitObjectType.NewCombo);
|
||||
type &= (HitObjectType)0xF;
|
||||
type &= ~HitObjectType.NewCombo;
|
||||
|
||||
HitObject result;
|
||||
@ -91,6 +90,14 @@ namespace osu.Game.Modes.Objects
|
||||
EndTime = Convert.ToDouble(split[5], CultureInfo.InvariantCulture)
|
||||
};
|
||||
break;
|
||||
case HitObjectType.Hold:
|
||||
// Note: Hold is generated by BMS converts
|
||||
result = new LegacyHold
|
||||
{
|
||||
Position = new Vector2(int.Parse(split[0]), int.Parse(split[1])),
|
||||
NewCombo = combo
|
||||
};
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException($@"Unknown hit object type {type}");
|
||||
}
|
||||
|
Reference in New Issue
Block a user