1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 15:33:21 +08:00

Add explicit CentreHit/RimHit classes.

This commit is contained in:
smoogipooo 2017-03-30 15:51:16 +09:00
parent ff325ac330
commit cf4d11c51c
6 changed files with 25 additions and 16 deletions

View File

@ -74,14 +74,23 @@ namespace osu.Game.Modes.Taiko.Beatmaps
}; };
} }
HitType type = (sample & ~(SampleType.Finish | SampleType.Normal)) == 0 ? HitType.Centre : HitType.Rim; bool isCentre = (sample & ~(SampleType.Finish | SampleType.Normal)) == 0;
return new Hit if (isCentre)
{
return new CentreHit
{
StartTime = original.StartTime,
Sample = original.Sample,
IsStrong = strong
};
}
return new RimHit
{ {
StartTime = original.StartTime, StartTime = original.StartTime,
Sample = original.Sample, Sample = original.Sample,
IsStrong = strong, IsStrong = strong,
Type = type
}; };
} }
} }

View File

@ -3,12 +3,7 @@
namespace osu.Game.Modes.Taiko.Objects namespace osu.Game.Modes.Taiko.Objects
{ {
/// <summary> public class CentreHit : Hit
/// Describes whether a hit is a centre-hit or a rim-hit.
/// </summary>
public enum HitType
{ {
Centre,
Rim
} }
} }

View File

@ -8,11 +8,6 @@ namespace osu.Game.Modes.Taiko.Objects
{ {
public class Hit : TaikoHitObject public class Hit : TaikoHitObject
{ {
/// <summary>
/// Whether this hit is a centre-hit or a rim-hit.
/// </summary>
public HitType Type;
/// <summary> /// <summary>
/// The hit window that results in a "GREAT" hit. /// The hit window that results in a "GREAT" hit.
/// </summary> /// </summary>

View File

@ -0,0 +1,9 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Modes.Taiko.Objects
{
public class RimHit : Hit
{
}
}

View File

@ -84,7 +84,7 @@ namespace osu.Game.Modes.Taiko
} }
else if (hit != null) else if (hit != null)
{ {
if (hit.Type == HitType.Centre) if (hit is CentreHit)
{ {
if (h.IsStrong) if (h.IsStrong)
button = LegacyButtonState.Right1 | LegacyButtonState.Right2; button = LegacyButtonState.Right1 | LegacyButtonState.Right2;

View File

@ -53,6 +53,7 @@
<Compile Include="Judgements\TaikoJudgement.cs" /> <Compile Include="Judgements\TaikoJudgement.cs" />
<Compile Include="Judgements\TaikoHitResult.cs" /> <Compile Include="Judgements\TaikoHitResult.cs" />
<Compile Include="LegacyTaikoReplay.cs" /> <Compile Include="LegacyTaikoReplay.cs" />
<Compile Include="Objects\CentreHit.cs" />
<Compile Include="Objects\Drawable\DrawableRimHit.cs" /> <Compile Include="Objects\Drawable\DrawableRimHit.cs" />
<Compile Include="Objects\Drawable\DrawableStrongRimHit.cs" /> <Compile Include="Objects\Drawable\DrawableStrongRimHit.cs" />
<Compile Include="Objects\Drawable\DrawableCentreHit.cs" /> <Compile Include="Objects\Drawable\DrawableCentreHit.cs" />
@ -70,7 +71,7 @@
<Compile Include="Objects\DrumRoll.cs" /> <Compile Include="Objects\DrumRoll.cs" />
<Compile Include="Objects\DrumRollTick.cs" /> <Compile Include="Objects\DrumRollTick.cs" />
<Compile Include="Objects\Hit.cs" /> <Compile Include="Objects\Hit.cs" />
<Compile Include="Objects\HitType.cs" /> <Compile Include="Objects\RimHit.cs" />
<Compile Include="Objects\Swell.cs" /> <Compile Include="Objects\Swell.cs" />
<Compile Include="TaikoAutoReplay.cs" /> <Compile Include="TaikoAutoReplay.cs" />
<Compile Include="Objects\TaikoHitObject.cs" /> <Compile Include="Objects\TaikoHitObject.cs" />