Make HitObjectType more accessible.

# Conflicts:
#	osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs
This commit is contained in:
Dean Herbert 2017-02-14 09:40:26 +09:00
parent 9f96a511a7
commit 9a5ac64332
2 changed files with 20 additions and 20 deletions

View File

@ -31,19 +31,19 @@ public override void SetDefaultsFromBeatmap(Beatmap beatmap)
Scale = (1.0f - 0.7f * (beatmap.BeatmapInfo.BaseDifficulty.CircleSize - 5) / 5) / 2;
}
}
[Flags]
internal enum HitObjectType
{
Circle = 1,
Slider = 2,
NewCombo = 4,
CircleNewCombo = 5,
SliderNewCombo = 6,
Spinner = 8,
ColourHax = 122,
Hold = 128,
ManiaLong = 128,
}
[Flags]
public enum HitObjectType
{
Circle = 1,
Slider = 2,
NewCombo = 4,
CircleNewCombo = 5,
SliderNewCombo = 6,
Spinner = 8,
ColourHax = 122,
Hold = 128,
ManiaLong = 128,
}
}

View File

@ -18,17 +18,17 @@ public class OsuHitObjectParser : HitObjectParser
public override HitObject Parse(string text)
{
string[] split = text.Split(',');
var type = (OsuHitObject.HitObjectType)int.Parse(split[3]);
bool combo = type.HasFlag(OsuHitObject.HitObjectType.NewCombo);
type &= (OsuHitObject.HitObjectType)0xF;
type &= ~OsuHitObject.HitObjectType.NewCombo;
var type = (HitObjectType)int.Parse(split[3]);
bool combo = type.HasFlag(HitObjectType.NewCombo);
type &= (HitObjectType)0xF;
type &= ~HitObjectType.NewCombo;
OsuHitObject result;
switch (type)
{
case OsuHitObject.HitObjectType.Circle:
case HitObjectType.Circle:
result = new HitCircle();
break;
case OsuHitObject.HitObjectType.Slider:
case HitObjectType.Slider:
Slider s = new Slider();
CurveTypes curveType = CurveTypes.Catmull;
@ -92,7 +92,7 @@ public override HitObject Parse(string text)
result = s;
break;
case OsuHitObject.HitObjectType.Spinner:
case HitObjectType.Spinner:
result = new Spinner();
break;
default: