diff --git a/osu.Game/Beatmaps/Legacy/LegacyHitObjectType.cs b/osu.Game/Beatmaps/Legacy/LegacyHitObjectType.cs new file mode 100644 index 0000000000..9223f7df31 --- /dev/null +++ b/osu.Game/Beatmaps/Legacy/LegacyHitObjectType.cs @@ -0,0 +1,15 @@ +using System; + +namespace osu.Game.Beatmaps.Legacy +{ + [Flags] + internal enum LegacyHitObjectType + { + Circle = 1, + Slider = 1 << 1, + NewCombo = 1 << 2, + Spinner = 1 << 3, + ComboOffset = (1 << 4) | (1 << 5) | (1 << 6), + Hold = 1 << 7 + } +} diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index c22955cbf1..b83c67acff 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -11,6 +11,7 @@ using osu.Game.Audio; using System.Linq; using JetBrains.Annotations; using osu.Framework.MathUtils; +using osu.Game.Beatmaps.Legacy; namespace osu.Game.Rulesets.Objects.Legacy { @@ -46,27 +47,27 @@ namespace osu.Game.Rulesets.Objects.Legacy double startTime = Parsing.ParseDouble(split[2]) + Offset; - ConvertHitObjectType type = (ConvertHitObjectType)Parsing.ParseInt(split[3]); + LegacyHitObjectType type = (LegacyHitObjectType)Parsing.ParseInt(split[3]); - int comboOffset = (int)(type & ConvertHitObjectType.ComboOffset) >> 4; - type &= ~ConvertHitObjectType.ComboOffset; + int comboOffset = (int)(type & LegacyHitObjectType.ComboOffset) >> 4; + type &= ~LegacyHitObjectType.ComboOffset; - bool combo = type.HasFlag(ConvertHitObjectType.NewCombo); - type &= ~ConvertHitObjectType.NewCombo; + bool combo = type.HasFlag(LegacyHitObjectType.NewCombo); + type &= ~LegacyHitObjectType.NewCombo; var soundType = (LegacyHitSoundType)Parsing.ParseInt(split[4]); var bankInfo = new SampleBankInfo(); HitObject result = null; - if (type.HasFlag(ConvertHitObjectType.Circle)) + if (type.HasFlag(LegacyHitObjectType.Circle)) { result = CreateHit(pos, combo, comboOffset); if (split.Length > 5) readCustomSampleBanks(split[5], bankInfo); } - else if (type.HasFlag(ConvertHitObjectType.Slider)) + else if (type.HasFlag(LegacyHitObjectType.Slider)) { PathType pathType = PathType.Catmull; double? length = null; @@ -186,7 +187,7 @@ namespace osu.Game.Rulesets.Objects.Legacy // The samples are played when the slider ends, which is the last node result.Samples = nodeSamples[nodeSamples.Count - 1]; } - else if (type.HasFlag(ConvertHitObjectType.Spinner)) + else if (type.HasFlag(LegacyHitObjectType.Spinner)) { double endTime = Math.Max(startTime, Parsing.ParseDouble(split[5]) + Offset); @@ -195,7 +196,7 @@ namespace osu.Game.Rulesets.Objects.Legacy if (split.Length > 6) readCustomSampleBanks(split[6], bankInfo); } - else if (type.HasFlag(ConvertHitObjectType.Hold)) + else if (type.HasFlag(LegacyHitObjectType.Hold)) { // Note: Hold is generated by BMS converts diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectType.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectType.cs deleted file mode 100644 index eab37b682c..0000000000 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectType.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using System; - -namespace osu.Game.Rulesets.Objects.Legacy -{ - [Flags] - internal enum ConvertHitObjectType - { - Circle = 1, - Slider = 1 << 1, - NewCombo = 1 << 2, - Spinner = 1 << 3, - ComboOffset = (1 << 4) | (1 << 5) | (1 << 6), - Hold = 1 << 7 - } -}