mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Extract legacy hitobject type enum
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user