Fix unit tests.

This commit is contained in:
smoogipooo
2017-03-14 18:46:34 +09:00
parent ad9583a179
commit 4c7f0fcb73
7 changed files with 38 additions and 12 deletions

View File

@ -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
{

View 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; }
}
}

View File

@ -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
{

View File

@ -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
{

View File

@ -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}");
}